1use stripe_client_core::{
2 RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListSetupIntentBuilder {
7 #[serde(skip_serializing_if = "Option::is_none")]
8 attach_to_self: Option<bool>,
9 #[serde(skip_serializing_if = "Option::is_none")]
10 created: Option<stripe_types::RangeQueryTs>,
11 #[serde(skip_serializing_if = "Option::is_none")]
12 customer: Option<String>,
13 #[serde(skip_serializing_if = "Option::is_none")]
14 ending_before: Option<String>,
15 #[serde(skip_serializing_if = "Option::is_none")]
16 expand: Option<Vec<String>>,
17 #[serde(skip_serializing_if = "Option::is_none")]
18 limit: Option<i64>,
19 #[serde(skip_serializing_if = "Option::is_none")]
20 payment_method: Option<String>,
21 #[serde(skip_serializing_if = "Option::is_none")]
22 starting_after: Option<String>,
23}
24impl ListSetupIntentBuilder {
25 fn new() -> Self {
26 Self {
27 attach_to_self: None,
28 created: None,
29 customer: None,
30 ending_before: None,
31 expand: None,
32 limit: None,
33 payment_method: None,
34 starting_after: None,
35 }
36 }
37}
38#[derive(Clone, Debug, serde::Serialize)]
40pub struct ListSetupIntent {
41 inner: ListSetupIntentBuilder,
42}
43impl ListSetupIntent {
44 pub fn new() -> Self {
46 Self { inner: ListSetupIntentBuilder::new() }
47 }
48 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
53 self.inner.attach_to_self = Some(attach_to_self.into());
54 self
55 }
56 pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
59 self.inner.created = Some(created.into());
60 self
61 }
62 pub fn customer(mut self, customer: impl Into<String>) -> Self {
64 self.inner.customer = Some(customer.into());
65 self
66 }
67 pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
71 self.inner.ending_before = Some(ending_before.into());
72 self
73 }
74 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
76 self.inner.expand = Some(expand.into());
77 self
78 }
79 pub fn limit(mut self, limit: impl Into<i64>) -> Self {
82 self.inner.limit = Some(limit.into());
83 self
84 }
85 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
87 self.inner.payment_method = Some(payment_method.into());
88 self
89 }
90 pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
94 self.inner.starting_after = Some(starting_after.into());
95 self
96 }
97}
98impl Default for ListSetupIntent {
99 fn default() -> Self {
100 Self::new()
101 }
102}
103impl ListSetupIntent {
104 pub async fn send<C: StripeClient>(
106 &self,
107 client: &C,
108 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
109 self.customize().send(client).await
110 }
111
112 pub fn send_blocking<C: StripeBlockingClient>(
114 &self,
115 client: &C,
116 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
117 self.customize().send_blocking(client)
118 }
119
120 pub fn paginate(
121 &self,
122 ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::SetupIntent>> {
123 stripe_client_core::ListPaginator::new_list("/setup_intents", &self.inner)
124 }
125}
126
127impl StripeRequest for ListSetupIntent {
128 type Output = stripe_types::List<stripe_shared::SetupIntent>;
129
130 fn build(&self) -> RequestBuilder {
131 RequestBuilder::new(StripeMethod::Get, "/setup_intents").query(&self.inner)
132 }
133}
134#[derive(Clone, Debug, serde::Serialize)]
135struct RetrieveSetupIntentBuilder {
136 #[serde(skip_serializing_if = "Option::is_none")]
137 client_secret: Option<String>,
138 #[serde(skip_serializing_if = "Option::is_none")]
139 expand: Option<Vec<String>>,
140}
141impl RetrieveSetupIntentBuilder {
142 fn new() -> Self {
143 Self { client_secret: None, expand: None }
144 }
145}
146#[derive(Clone, Debug, serde::Serialize)]
154pub struct RetrieveSetupIntent {
155 inner: RetrieveSetupIntentBuilder,
156 intent: stripe_shared::SetupIntentId,
157}
158impl RetrieveSetupIntent {
159 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
161 Self { intent: intent.into(), inner: RetrieveSetupIntentBuilder::new() }
162 }
163 pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
166 self.inner.client_secret = Some(client_secret.into());
167 self
168 }
169 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
171 self.inner.expand = Some(expand.into());
172 self
173 }
174}
175impl RetrieveSetupIntent {
176 pub async fn send<C: StripeClient>(
178 &self,
179 client: &C,
180 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
181 self.customize().send(client).await
182 }
183
184 pub fn send_blocking<C: StripeBlockingClient>(
186 &self,
187 client: &C,
188 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
189 self.customize().send_blocking(client)
190 }
191}
192
193impl StripeRequest for RetrieveSetupIntent {
194 type Output = stripe_shared::SetupIntent;
195
196 fn build(&self) -> RequestBuilder {
197 let intent = &self.intent;
198 RequestBuilder::new(StripeMethod::Get, format!("/setup_intents/{intent}"))
199 .query(&self.inner)
200 }
201}
202#[derive(Clone, Debug, serde::Serialize)]
203struct CreateSetupIntentBuilder {
204 #[serde(skip_serializing_if = "Option::is_none")]
205 attach_to_self: Option<bool>,
206 #[serde(skip_serializing_if = "Option::is_none")]
207 automatic_payment_methods: Option<CreateSetupIntentAutomaticPaymentMethods>,
208 #[serde(skip_serializing_if = "Option::is_none")]
209 confirm: Option<bool>,
210 #[serde(skip_serializing_if = "Option::is_none")]
211 confirmation_token: Option<String>,
212 #[serde(skip_serializing_if = "Option::is_none")]
213 customer: Option<String>,
214 #[serde(skip_serializing_if = "Option::is_none")]
215 description: Option<String>,
216 #[serde(skip_serializing_if = "Option::is_none")]
217 expand: Option<Vec<String>>,
218 #[serde(skip_serializing_if = "Option::is_none")]
219 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
220 #[serde(skip_serializing_if = "Option::is_none")]
221 mandate_data: Option<CreateSetupIntentMandateData>,
222 #[serde(skip_serializing_if = "Option::is_none")]
223 metadata: Option<std::collections::HashMap<String, String>>,
224 #[serde(skip_serializing_if = "Option::is_none")]
225 on_behalf_of: Option<String>,
226 #[serde(skip_serializing_if = "Option::is_none")]
227 payment_method: Option<String>,
228 #[serde(skip_serializing_if = "Option::is_none")]
229 payment_method_configuration: Option<String>,
230 #[serde(skip_serializing_if = "Option::is_none")]
231 payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
232 #[serde(skip_serializing_if = "Option::is_none")]
233 payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
234 #[serde(skip_serializing_if = "Option::is_none")]
235 payment_method_types: Option<Vec<String>>,
236 #[serde(skip_serializing_if = "Option::is_none")]
237 return_url: Option<String>,
238 #[serde(skip_serializing_if = "Option::is_none")]
239 single_use: Option<CreateSetupIntentSingleUse>,
240 #[serde(skip_serializing_if = "Option::is_none")]
241 usage: Option<CreateSetupIntentUsage>,
242 #[serde(skip_serializing_if = "Option::is_none")]
243 use_stripe_sdk: Option<bool>,
244}
245impl CreateSetupIntentBuilder {
246 fn new() -> Self {
247 Self {
248 attach_to_self: None,
249 automatic_payment_methods: None,
250 confirm: None,
251 confirmation_token: None,
252 customer: None,
253 description: None,
254 expand: None,
255 flow_directions: None,
256 mandate_data: None,
257 metadata: None,
258 on_behalf_of: None,
259 payment_method: None,
260 payment_method_configuration: None,
261 payment_method_data: None,
262 payment_method_options: None,
263 payment_method_types: None,
264 return_url: None,
265 single_use: None,
266 usage: None,
267 use_stripe_sdk: None,
268 }
269 }
270}
271#[derive(Copy, Clone, Debug, serde::Serialize)]
273pub struct CreateSetupIntentAutomaticPaymentMethods {
274 #[serde(skip_serializing_if = "Option::is_none")]
279 pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
280 pub enabled: bool,
282}
283impl CreateSetupIntentAutomaticPaymentMethods {
284 pub fn new(enabled: impl Into<bool>) -> Self {
285 Self { allow_redirects: None, enabled: enabled.into() }
286 }
287}
288#[derive(Copy, Clone, Eq, PartialEq)]
293pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
294 Always,
295 Never,
296}
297impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
298 pub fn as_str(self) -> &'static str {
299 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
300 match self {
301 Always => "always",
302 Never => "never",
303 }
304 }
305}
306
307impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
308 type Err = stripe_types::StripeParseError;
309 fn from_str(s: &str) -> Result<Self, Self::Err> {
310 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
311 match s {
312 "always" => Ok(Always),
313 "never" => Ok(Never),
314 _ => Err(stripe_types::StripeParseError),
315 }
316 }
317}
318impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
319 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
320 f.write_str(self.as_str())
321 }
322}
323
324impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
325 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
326 f.write_str(self.as_str())
327 }
328}
329impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
330 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
331 where
332 S: serde::Serializer,
333 {
334 serializer.serialize_str(self.as_str())
335 }
336}
337#[cfg(feature = "deserialize")]
338impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
339 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
340 use std::str::FromStr;
341 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
342 Self::from_str(&s).map_err(|_| {
343 serde::de::Error::custom(
344 "Unknown value for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects",
345 )
346 })
347 }
348}
349#[derive(Clone, Debug, serde::Serialize)]
352pub struct CreateSetupIntentMandateData {
353 pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
355}
356impl CreateSetupIntentMandateData {
357 pub fn new(
358 customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
359 ) -> Self {
360 Self { customer_acceptance: customer_acceptance.into() }
361 }
362}
363#[derive(Clone, Debug, serde::Serialize)]
365pub struct CreateSetupIntentMandateDataCustomerAcceptance {
366 #[serde(skip_serializing_if = "Option::is_none")]
368 pub accepted_at: Option<stripe_types::Timestamp>,
369 #[serde(skip_serializing_if = "Option::is_none")]
371 #[serde(with = "stripe_types::with_serde_json_opt")]
372 pub offline: Option<miniserde::json::Value>,
373 #[serde(skip_serializing_if = "Option::is_none")]
375 pub online: Option<OnlineParam>,
376 #[serde(rename = "type")]
379 pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
380}
381impl CreateSetupIntentMandateDataCustomerAcceptance {
382 pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
383 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
384 }
385}
386#[derive(Copy, Clone, Eq, PartialEq)]
389pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
390 Offline,
391 Online,
392}
393impl CreateSetupIntentMandateDataCustomerAcceptanceType {
394 pub fn as_str(self) -> &'static str {
395 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
396 match self {
397 Offline => "offline",
398 Online => "online",
399 }
400 }
401}
402
403impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
404 type Err = stripe_types::StripeParseError;
405 fn from_str(s: &str) -> Result<Self, Self::Err> {
406 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
407 match s {
408 "offline" => Ok(Offline),
409 "online" => Ok(Online),
410 _ => Err(stripe_types::StripeParseError),
411 }
412 }
413}
414impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
415 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
416 f.write_str(self.as_str())
417 }
418}
419
420impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
421 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
422 f.write_str(self.as_str())
423 }
424}
425impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
426 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
427 where
428 S: serde::Serializer,
429 {
430 serializer.serialize_str(self.as_str())
431 }
432}
433#[cfg(feature = "deserialize")]
434impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
435 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
436 use std::str::FromStr;
437 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
438 Self::from_str(&s).map_err(|_| {
439 serde::de::Error::custom(
440 "Unknown value for CreateSetupIntentMandateDataCustomerAcceptanceType",
441 )
442 })
443 }
444}
445#[derive(Clone, Debug, serde::Serialize)]
448pub struct CreateSetupIntentPaymentMethodData {
449 #[serde(skip_serializing_if = "Option::is_none")]
451 pub acss_debit: Option<PaymentMethodParam>,
452 #[serde(skip_serializing_if = "Option::is_none")]
454 #[serde(with = "stripe_types::with_serde_json_opt")]
455 pub affirm: Option<miniserde::json::Value>,
456 #[serde(skip_serializing_if = "Option::is_none")]
458 #[serde(with = "stripe_types::with_serde_json_opt")]
459 pub afterpay_clearpay: Option<miniserde::json::Value>,
460 #[serde(skip_serializing_if = "Option::is_none")]
462 #[serde(with = "stripe_types::with_serde_json_opt")]
463 pub alipay: Option<miniserde::json::Value>,
464 #[serde(skip_serializing_if = "Option::is_none")]
468 pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
469 #[serde(skip_serializing_if = "Option::is_none")]
471 #[serde(with = "stripe_types::with_serde_json_opt")]
472 pub alma: Option<miniserde::json::Value>,
473 #[serde(skip_serializing_if = "Option::is_none")]
475 #[serde(with = "stripe_types::with_serde_json_opt")]
476 pub amazon_pay: Option<miniserde::json::Value>,
477 #[serde(skip_serializing_if = "Option::is_none")]
479 pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
480 #[serde(skip_serializing_if = "Option::is_none")]
482 pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
483 #[serde(skip_serializing_if = "Option::is_none")]
485 #[serde(with = "stripe_types::with_serde_json_opt")]
486 pub bancontact: Option<miniserde::json::Value>,
487 #[serde(skip_serializing_if = "Option::is_none")]
489 #[serde(with = "stripe_types::with_serde_json_opt")]
490 pub billie: Option<miniserde::json::Value>,
491 #[serde(skip_serializing_if = "Option::is_none")]
493 pub billing_details: Option<BillingDetailsInnerParams>,
494 #[serde(skip_serializing_if = "Option::is_none")]
496 #[serde(with = "stripe_types::with_serde_json_opt")]
497 pub blik: Option<miniserde::json::Value>,
498 #[serde(skip_serializing_if = "Option::is_none")]
500 pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
501 #[serde(skip_serializing_if = "Option::is_none")]
503 #[serde(with = "stripe_types::with_serde_json_opt")]
504 pub cashapp: Option<miniserde::json::Value>,
505 #[serde(skip_serializing_if = "Option::is_none")]
507 #[serde(with = "stripe_types::with_serde_json_opt")]
508 pub crypto: Option<miniserde::json::Value>,
509 #[serde(skip_serializing_if = "Option::is_none")]
511 #[serde(with = "stripe_types::with_serde_json_opt")]
512 pub customer_balance: Option<miniserde::json::Value>,
513 #[serde(skip_serializing_if = "Option::is_none")]
515 pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
516 #[serde(skip_serializing_if = "Option::is_none")]
518 pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
519 #[serde(skip_serializing_if = "Option::is_none")]
521 #[serde(with = "stripe_types::with_serde_json_opt")]
522 pub giropay: Option<miniserde::json::Value>,
523 #[serde(skip_serializing_if = "Option::is_none")]
525 #[serde(with = "stripe_types::with_serde_json_opt")]
526 pub grabpay: Option<miniserde::json::Value>,
527 #[serde(skip_serializing_if = "Option::is_none")]
529 pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
530 #[serde(skip_serializing_if = "Option::is_none")]
532 #[serde(with = "stripe_types::with_serde_json_opt")]
533 pub interac_present: Option<miniserde::json::Value>,
534 #[serde(skip_serializing_if = "Option::is_none")]
536 #[serde(with = "stripe_types::with_serde_json_opt")]
537 pub kakao_pay: Option<miniserde::json::Value>,
538 #[serde(skip_serializing_if = "Option::is_none")]
540 pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
541 #[serde(skip_serializing_if = "Option::is_none")]
543 #[serde(with = "stripe_types::with_serde_json_opt")]
544 pub konbini: Option<miniserde::json::Value>,
545 #[serde(skip_serializing_if = "Option::is_none")]
547 #[serde(with = "stripe_types::with_serde_json_opt")]
548 pub kr_card: Option<miniserde::json::Value>,
549 #[serde(skip_serializing_if = "Option::is_none")]
551 #[serde(with = "stripe_types::with_serde_json_opt")]
552 pub link: Option<miniserde::json::Value>,
553 #[serde(skip_serializing_if = "Option::is_none")]
555 #[serde(with = "stripe_types::with_serde_json_opt")]
556 pub mb_way: Option<miniserde::json::Value>,
557 #[serde(skip_serializing_if = "Option::is_none")]
562 pub metadata: Option<std::collections::HashMap<String, String>>,
563 #[serde(skip_serializing_if = "Option::is_none")]
565 #[serde(with = "stripe_types::with_serde_json_opt")]
566 pub mobilepay: Option<miniserde::json::Value>,
567 #[serde(skip_serializing_if = "Option::is_none")]
569 #[serde(with = "stripe_types::with_serde_json_opt")]
570 pub multibanco: Option<miniserde::json::Value>,
571 #[serde(skip_serializing_if = "Option::is_none")]
573 pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
574 #[serde(skip_serializing_if = "Option::is_none")]
576 pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
577 #[serde(skip_serializing_if = "Option::is_none")]
579 #[serde(with = "stripe_types::with_serde_json_opt")]
580 pub oxxo: Option<miniserde::json::Value>,
581 #[serde(skip_serializing_if = "Option::is_none")]
583 pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
584 #[serde(skip_serializing_if = "Option::is_none")]
586 #[serde(with = "stripe_types::with_serde_json_opt")]
587 pub pay_by_bank: Option<miniserde::json::Value>,
588 #[serde(skip_serializing_if = "Option::is_none")]
590 #[serde(with = "stripe_types::with_serde_json_opt")]
591 pub payco: Option<miniserde::json::Value>,
592 #[serde(skip_serializing_if = "Option::is_none")]
594 #[serde(with = "stripe_types::with_serde_json_opt")]
595 pub paynow: Option<miniserde::json::Value>,
596 #[serde(skip_serializing_if = "Option::is_none")]
598 #[serde(with = "stripe_types::with_serde_json_opt")]
599 pub paypal: Option<miniserde::json::Value>,
600 #[serde(skip_serializing_if = "Option::is_none")]
602 #[serde(with = "stripe_types::with_serde_json_opt")]
603 pub pix: Option<miniserde::json::Value>,
604 #[serde(skip_serializing_if = "Option::is_none")]
606 #[serde(with = "stripe_types::with_serde_json_opt")]
607 pub promptpay: Option<miniserde::json::Value>,
608 #[serde(skip_serializing_if = "Option::is_none")]
611 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
612 #[serde(skip_serializing_if = "Option::is_none")]
614 #[serde(with = "stripe_types::with_serde_json_opt")]
615 pub revolut_pay: Option<miniserde::json::Value>,
616 #[serde(skip_serializing_if = "Option::is_none")]
618 #[serde(with = "stripe_types::with_serde_json_opt")]
619 pub samsung_pay: Option<miniserde::json::Value>,
620 #[serde(skip_serializing_if = "Option::is_none")]
622 #[serde(with = "stripe_types::with_serde_json_opt")]
623 pub satispay: Option<miniserde::json::Value>,
624 #[serde(skip_serializing_if = "Option::is_none")]
626 pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
627 #[serde(skip_serializing_if = "Option::is_none")]
629 pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
630 #[serde(skip_serializing_if = "Option::is_none")]
632 #[serde(with = "stripe_types::with_serde_json_opt")]
633 pub swish: Option<miniserde::json::Value>,
634 #[serde(skip_serializing_if = "Option::is_none")]
636 #[serde(with = "stripe_types::with_serde_json_opt")]
637 pub twint: Option<miniserde::json::Value>,
638 #[serde(rename = "type")]
642 pub type_: CreateSetupIntentPaymentMethodDataType,
643 #[serde(skip_serializing_if = "Option::is_none")]
645 pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
646 #[serde(skip_serializing_if = "Option::is_none")]
648 #[serde(with = "stripe_types::with_serde_json_opt")]
649 pub wechat_pay: Option<miniserde::json::Value>,
650 #[serde(skip_serializing_if = "Option::is_none")]
652 #[serde(with = "stripe_types::with_serde_json_opt")]
653 pub zip: Option<miniserde::json::Value>,
654}
655impl CreateSetupIntentPaymentMethodData {
656 pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
657 Self {
658 acss_debit: None,
659 affirm: None,
660 afterpay_clearpay: None,
661 alipay: None,
662 allow_redisplay: None,
663 alma: None,
664 amazon_pay: None,
665 au_becs_debit: None,
666 bacs_debit: None,
667 bancontact: None,
668 billie: None,
669 billing_details: None,
670 blik: None,
671 boleto: None,
672 cashapp: None,
673 crypto: None,
674 customer_balance: None,
675 eps: None,
676 fpx: None,
677 giropay: None,
678 grabpay: None,
679 ideal: None,
680 interac_present: None,
681 kakao_pay: None,
682 klarna: None,
683 konbini: None,
684 kr_card: None,
685 link: None,
686 mb_way: None,
687 metadata: None,
688 mobilepay: None,
689 multibanco: None,
690 naver_pay: None,
691 nz_bank_account: None,
692 oxxo: None,
693 p24: None,
694 pay_by_bank: None,
695 payco: None,
696 paynow: None,
697 paypal: None,
698 pix: None,
699 promptpay: None,
700 radar_options: None,
701 revolut_pay: None,
702 samsung_pay: None,
703 satispay: None,
704 sepa_debit: None,
705 sofort: None,
706 swish: None,
707 twint: None,
708 type_: type_.into(),
709 us_bank_account: None,
710 wechat_pay: None,
711 zip: None,
712 }
713 }
714}
715#[derive(Copy, Clone, Eq, PartialEq)]
719pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
720 Always,
721 Limited,
722 Unspecified,
723}
724impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
725 pub fn as_str(self) -> &'static str {
726 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
727 match self {
728 Always => "always",
729 Limited => "limited",
730 Unspecified => "unspecified",
731 }
732 }
733}
734
735impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
736 type Err = stripe_types::StripeParseError;
737 fn from_str(s: &str) -> Result<Self, Self::Err> {
738 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
739 match s {
740 "always" => Ok(Always),
741 "limited" => Ok(Limited),
742 "unspecified" => Ok(Unspecified),
743 _ => Err(stripe_types::StripeParseError),
744 }
745 }
746}
747impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
748 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
749 f.write_str(self.as_str())
750 }
751}
752
753impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
754 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
755 f.write_str(self.as_str())
756 }
757}
758impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
759 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
760 where
761 S: serde::Serializer,
762 {
763 serializer.serialize_str(self.as_str())
764 }
765}
766#[cfg(feature = "deserialize")]
767impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
768 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
769 use std::str::FromStr;
770 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
771 Self::from_str(&s).map_err(|_| {
772 serde::de::Error::custom(
773 "Unknown value for CreateSetupIntentPaymentMethodDataAllowRedisplay",
774 )
775 })
776 }
777}
778#[derive(Clone, Debug, serde::Serialize)]
780pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
781 pub account_number: String,
783 pub bsb_number: String,
785}
786impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
787 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
788 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
789 }
790}
791#[derive(Clone, Debug, serde::Serialize)]
793pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
794 #[serde(skip_serializing_if = "Option::is_none")]
796 pub account_number: Option<String>,
797 #[serde(skip_serializing_if = "Option::is_none")]
799 pub sort_code: Option<String>,
800}
801impl CreateSetupIntentPaymentMethodDataBacsDebit {
802 pub fn new() -> Self {
803 Self { account_number: None, sort_code: None }
804 }
805}
806impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
807 fn default() -> Self {
808 Self::new()
809 }
810}
811#[derive(Clone, Debug, serde::Serialize)]
813pub struct CreateSetupIntentPaymentMethodDataBoleto {
814 pub tax_id: String,
816}
817impl CreateSetupIntentPaymentMethodDataBoleto {
818 pub fn new(tax_id: impl Into<String>) -> Self {
819 Self { tax_id: tax_id.into() }
820 }
821}
822#[derive(Clone, Debug, serde::Serialize)]
824pub struct CreateSetupIntentPaymentMethodDataEps {
825 #[serde(skip_serializing_if = "Option::is_none")]
827 pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
828}
829impl CreateSetupIntentPaymentMethodDataEps {
830 pub fn new() -> Self {
831 Self { bank: None }
832 }
833}
834impl Default for CreateSetupIntentPaymentMethodDataEps {
835 fn default() -> Self {
836 Self::new()
837 }
838}
839#[derive(Clone, Eq, PartialEq)]
841#[non_exhaustive]
842pub enum CreateSetupIntentPaymentMethodDataEpsBank {
843 ArzteUndApothekerBank,
844 AustrianAnadiBankAg,
845 BankAustria,
846 BankhausCarlSpangler,
847 BankhausSchelhammerUndSchatteraAg,
848 BawagPskAg,
849 BksBankAg,
850 BrullKallmusBankAg,
851 BtvVierLanderBank,
852 CapitalBankGraweGruppeAg,
853 DeutscheBankAg,
854 Dolomitenbank,
855 EasybankAg,
856 ErsteBankUndSparkassen,
857 HypoAlpeadriabankInternationalAg,
858 HypoBankBurgenlandAktiengesellschaft,
859 HypoNoeLbFurNiederosterreichUWien,
860 HypoOberosterreichSalzburgSteiermark,
861 HypoTirolBankAg,
862 HypoVorarlbergBankAg,
863 MarchfelderBank,
864 OberbankAg,
865 RaiffeisenBankengruppeOsterreich,
866 SchoellerbankAg,
867 SpardaBankWien,
868 VolksbankGruppe,
869 VolkskreditbankAg,
870 VrBankBraunau,
871 Unknown(String),
873}
874impl CreateSetupIntentPaymentMethodDataEpsBank {
875 pub fn as_str(&self) -> &str {
876 use CreateSetupIntentPaymentMethodDataEpsBank::*;
877 match self {
878 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
879 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
880 BankAustria => "bank_austria",
881 BankhausCarlSpangler => "bankhaus_carl_spangler",
882 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
883 BawagPskAg => "bawag_psk_ag",
884 BksBankAg => "bks_bank_ag",
885 BrullKallmusBankAg => "brull_kallmus_bank_ag",
886 BtvVierLanderBank => "btv_vier_lander_bank",
887 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
888 DeutscheBankAg => "deutsche_bank_ag",
889 Dolomitenbank => "dolomitenbank",
890 EasybankAg => "easybank_ag",
891 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
892 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
893 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
894 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
895 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
896 HypoTirolBankAg => "hypo_tirol_bank_ag",
897 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
898 MarchfelderBank => "marchfelder_bank",
899 OberbankAg => "oberbank_ag",
900 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
901 SchoellerbankAg => "schoellerbank_ag",
902 SpardaBankWien => "sparda_bank_wien",
903 VolksbankGruppe => "volksbank_gruppe",
904 VolkskreditbankAg => "volkskreditbank_ag",
905 VrBankBraunau => "vr_bank_braunau",
906 Unknown(v) => v,
907 }
908 }
909}
910
911impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
912 type Err = std::convert::Infallible;
913 fn from_str(s: &str) -> Result<Self, Self::Err> {
914 use CreateSetupIntentPaymentMethodDataEpsBank::*;
915 match s {
916 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
917 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
918 "bank_austria" => Ok(BankAustria),
919 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
920 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
921 "bawag_psk_ag" => Ok(BawagPskAg),
922 "bks_bank_ag" => Ok(BksBankAg),
923 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
924 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
925 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
926 "deutsche_bank_ag" => Ok(DeutscheBankAg),
927 "dolomitenbank" => Ok(Dolomitenbank),
928 "easybank_ag" => Ok(EasybankAg),
929 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
930 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
931 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
932 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
933 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
934 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
935 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
936 "marchfelder_bank" => Ok(MarchfelderBank),
937 "oberbank_ag" => Ok(OberbankAg),
938 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
939 "schoellerbank_ag" => Ok(SchoellerbankAg),
940 "sparda_bank_wien" => Ok(SpardaBankWien),
941 "volksbank_gruppe" => Ok(VolksbankGruppe),
942 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
943 "vr_bank_braunau" => Ok(VrBankBraunau),
944 v => Ok(Unknown(v.to_owned())),
945 }
946 }
947}
948impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
949 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
950 f.write_str(self.as_str())
951 }
952}
953
954impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
955 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
956 f.write_str(self.as_str())
957 }
958}
959impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
960 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
961 where
962 S: serde::Serializer,
963 {
964 serializer.serialize_str(self.as_str())
965 }
966}
967#[cfg(feature = "deserialize")]
968impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
969 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
970 use std::str::FromStr;
971 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
972 Ok(Self::from_str(&s).unwrap())
973 }
974}
975#[derive(Clone, Debug, serde::Serialize)]
977pub struct CreateSetupIntentPaymentMethodDataFpx {
978 #[serde(skip_serializing_if = "Option::is_none")]
980 pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
981 pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
983}
984impl CreateSetupIntentPaymentMethodDataFpx {
985 pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
986 Self { account_holder_type: None, bank: bank.into() }
987 }
988}
989#[derive(Copy, Clone, Eq, PartialEq)]
991pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
992 Company,
993 Individual,
994}
995impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
996 pub fn as_str(self) -> &'static str {
997 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
998 match self {
999 Company => "company",
1000 Individual => "individual",
1001 }
1002 }
1003}
1004
1005impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1006 type Err = stripe_types::StripeParseError;
1007 fn from_str(s: &str) -> Result<Self, Self::Err> {
1008 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1009 match s {
1010 "company" => Ok(Company),
1011 "individual" => Ok(Individual),
1012 _ => Err(stripe_types::StripeParseError),
1013 }
1014 }
1015}
1016impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1017 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1018 f.write_str(self.as_str())
1019 }
1020}
1021
1022impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1023 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1024 f.write_str(self.as_str())
1025 }
1026}
1027impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1028 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1029 where
1030 S: serde::Serializer,
1031 {
1032 serializer.serialize_str(self.as_str())
1033 }
1034}
1035#[cfg(feature = "deserialize")]
1036impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1037 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1038 use std::str::FromStr;
1039 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1040 Self::from_str(&s).map_err(|_| {
1041 serde::de::Error::custom(
1042 "Unknown value for CreateSetupIntentPaymentMethodDataFpxAccountHolderType",
1043 )
1044 })
1045 }
1046}
1047#[derive(Clone, Eq, PartialEq)]
1049#[non_exhaustive]
1050pub enum CreateSetupIntentPaymentMethodDataFpxBank {
1051 AffinBank,
1052 Agrobank,
1053 AllianceBank,
1054 Ambank,
1055 BankIslam,
1056 BankMuamalat,
1057 BankOfChina,
1058 BankRakyat,
1059 Bsn,
1060 Cimb,
1061 DeutscheBank,
1062 HongLeongBank,
1063 Hsbc,
1064 Kfh,
1065 Maybank2e,
1066 Maybank2u,
1067 Ocbc,
1068 PbEnterprise,
1069 PublicBank,
1070 Rhb,
1071 StandardChartered,
1072 Uob,
1073 Unknown(String),
1075}
1076impl CreateSetupIntentPaymentMethodDataFpxBank {
1077 pub fn as_str(&self) -> &str {
1078 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1079 match self {
1080 AffinBank => "affin_bank",
1081 Agrobank => "agrobank",
1082 AllianceBank => "alliance_bank",
1083 Ambank => "ambank",
1084 BankIslam => "bank_islam",
1085 BankMuamalat => "bank_muamalat",
1086 BankOfChina => "bank_of_china",
1087 BankRakyat => "bank_rakyat",
1088 Bsn => "bsn",
1089 Cimb => "cimb",
1090 DeutscheBank => "deutsche_bank",
1091 HongLeongBank => "hong_leong_bank",
1092 Hsbc => "hsbc",
1093 Kfh => "kfh",
1094 Maybank2e => "maybank2e",
1095 Maybank2u => "maybank2u",
1096 Ocbc => "ocbc",
1097 PbEnterprise => "pb_enterprise",
1098 PublicBank => "public_bank",
1099 Rhb => "rhb",
1100 StandardChartered => "standard_chartered",
1101 Uob => "uob",
1102 Unknown(v) => v,
1103 }
1104 }
1105}
1106
1107impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
1108 type Err = std::convert::Infallible;
1109 fn from_str(s: &str) -> Result<Self, Self::Err> {
1110 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1111 match s {
1112 "affin_bank" => Ok(AffinBank),
1113 "agrobank" => Ok(Agrobank),
1114 "alliance_bank" => Ok(AllianceBank),
1115 "ambank" => Ok(Ambank),
1116 "bank_islam" => Ok(BankIslam),
1117 "bank_muamalat" => Ok(BankMuamalat),
1118 "bank_of_china" => Ok(BankOfChina),
1119 "bank_rakyat" => Ok(BankRakyat),
1120 "bsn" => Ok(Bsn),
1121 "cimb" => Ok(Cimb),
1122 "deutsche_bank" => Ok(DeutscheBank),
1123 "hong_leong_bank" => Ok(HongLeongBank),
1124 "hsbc" => Ok(Hsbc),
1125 "kfh" => Ok(Kfh),
1126 "maybank2e" => Ok(Maybank2e),
1127 "maybank2u" => Ok(Maybank2u),
1128 "ocbc" => Ok(Ocbc),
1129 "pb_enterprise" => Ok(PbEnterprise),
1130 "public_bank" => Ok(PublicBank),
1131 "rhb" => Ok(Rhb),
1132 "standard_chartered" => Ok(StandardChartered),
1133 "uob" => Ok(Uob),
1134 v => Ok(Unknown(v.to_owned())),
1135 }
1136 }
1137}
1138impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
1139 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1140 f.write_str(self.as_str())
1141 }
1142}
1143
1144impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1145 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1146 f.write_str(self.as_str())
1147 }
1148}
1149impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
1150 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1151 where
1152 S: serde::Serializer,
1153 {
1154 serializer.serialize_str(self.as_str())
1155 }
1156}
1157#[cfg(feature = "deserialize")]
1158impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
1159 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1160 use std::str::FromStr;
1161 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1162 Ok(Self::from_str(&s).unwrap())
1163 }
1164}
1165#[derive(Clone, Debug, serde::Serialize)]
1167pub struct CreateSetupIntentPaymentMethodDataIdeal {
1168 #[serde(skip_serializing_if = "Option::is_none")]
1172 pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
1173}
1174impl CreateSetupIntentPaymentMethodDataIdeal {
1175 pub fn new() -> Self {
1176 Self { bank: None }
1177 }
1178}
1179impl Default for CreateSetupIntentPaymentMethodDataIdeal {
1180 fn default() -> Self {
1181 Self::new()
1182 }
1183}
1184#[derive(Clone, Eq, PartialEq)]
1188#[non_exhaustive]
1189pub enum CreateSetupIntentPaymentMethodDataIdealBank {
1190 AbnAmro,
1191 AsnBank,
1192 Bunq,
1193 Buut,
1194 Handelsbanken,
1195 Ing,
1196 Knab,
1197 Moneyou,
1198 N26,
1199 Nn,
1200 Rabobank,
1201 Regiobank,
1202 Revolut,
1203 SnsBank,
1204 TriodosBank,
1205 VanLanschot,
1206 Yoursafe,
1207 Unknown(String),
1209}
1210impl CreateSetupIntentPaymentMethodDataIdealBank {
1211 pub fn as_str(&self) -> &str {
1212 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1213 match self {
1214 AbnAmro => "abn_amro",
1215 AsnBank => "asn_bank",
1216 Bunq => "bunq",
1217 Buut => "buut",
1218 Handelsbanken => "handelsbanken",
1219 Ing => "ing",
1220 Knab => "knab",
1221 Moneyou => "moneyou",
1222 N26 => "n26",
1223 Nn => "nn",
1224 Rabobank => "rabobank",
1225 Regiobank => "regiobank",
1226 Revolut => "revolut",
1227 SnsBank => "sns_bank",
1228 TriodosBank => "triodos_bank",
1229 VanLanschot => "van_lanschot",
1230 Yoursafe => "yoursafe",
1231 Unknown(v) => v,
1232 }
1233 }
1234}
1235
1236impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1237 type Err = std::convert::Infallible;
1238 fn from_str(s: &str) -> Result<Self, Self::Err> {
1239 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1240 match s {
1241 "abn_amro" => Ok(AbnAmro),
1242 "asn_bank" => Ok(AsnBank),
1243 "bunq" => Ok(Bunq),
1244 "buut" => Ok(Buut),
1245 "handelsbanken" => Ok(Handelsbanken),
1246 "ing" => Ok(Ing),
1247 "knab" => Ok(Knab),
1248 "moneyou" => Ok(Moneyou),
1249 "n26" => Ok(N26),
1250 "nn" => Ok(Nn),
1251 "rabobank" => Ok(Rabobank),
1252 "regiobank" => Ok(Regiobank),
1253 "revolut" => Ok(Revolut),
1254 "sns_bank" => Ok(SnsBank),
1255 "triodos_bank" => Ok(TriodosBank),
1256 "van_lanschot" => Ok(VanLanschot),
1257 "yoursafe" => Ok(Yoursafe),
1258 v => Ok(Unknown(v.to_owned())),
1259 }
1260 }
1261}
1262impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1263 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1264 f.write_str(self.as_str())
1265 }
1266}
1267
1268impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1269 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1270 f.write_str(self.as_str())
1271 }
1272}
1273impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1274 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1275 where
1276 S: serde::Serializer,
1277 {
1278 serializer.serialize_str(self.as_str())
1279 }
1280}
1281#[cfg(feature = "deserialize")]
1282impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1283 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1284 use std::str::FromStr;
1285 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1286 Ok(Self::from_str(&s).unwrap())
1287 }
1288}
1289#[derive(Copy, Clone, Debug, serde::Serialize)]
1291pub struct CreateSetupIntentPaymentMethodDataKlarna {
1292 #[serde(skip_serializing_if = "Option::is_none")]
1294 pub dob: Option<DateOfBirth>,
1295}
1296impl CreateSetupIntentPaymentMethodDataKlarna {
1297 pub fn new() -> Self {
1298 Self { dob: None }
1299 }
1300}
1301impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1302 fn default() -> Self {
1303 Self::new()
1304 }
1305}
1306#[derive(Copy, Clone, Debug, serde::Serialize)]
1308pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1309 #[serde(skip_serializing_if = "Option::is_none")]
1312 pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1313}
1314impl CreateSetupIntentPaymentMethodDataNaverPay {
1315 pub fn new() -> Self {
1316 Self { funding: None }
1317 }
1318}
1319impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1320 fn default() -> Self {
1321 Self::new()
1322 }
1323}
1324#[derive(Copy, Clone, Eq, PartialEq)]
1327pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1328 Card,
1329 Points,
1330}
1331impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1332 pub fn as_str(self) -> &'static str {
1333 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1334 match self {
1335 Card => "card",
1336 Points => "points",
1337 }
1338 }
1339}
1340
1341impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1342 type Err = stripe_types::StripeParseError;
1343 fn from_str(s: &str) -> Result<Self, Self::Err> {
1344 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1345 match s {
1346 "card" => Ok(Card),
1347 "points" => Ok(Points),
1348 _ => Err(stripe_types::StripeParseError),
1349 }
1350 }
1351}
1352impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1353 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1354 f.write_str(self.as_str())
1355 }
1356}
1357
1358impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1359 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1360 f.write_str(self.as_str())
1361 }
1362}
1363impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1364 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1365 where
1366 S: serde::Serializer,
1367 {
1368 serializer.serialize_str(self.as_str())
1369 }
1370}
1371#[cfg(feature = "deserialize")]
1372impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1373 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1374 use std::str::FromStr;
1375 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1376 Self::from_str(&s).map_err(|_| {
1377 serde::de::Error::custom(
1378 "Unknown value for CreateSetupIntentPaymentMethodDataNaverPayFunding",
1379 )
1380 })
1381 }
1382}
1383#[derive(Clone, Debug, serde::Serialize)]
1385pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1386 #[serde(skip_serializing_if = "Option::is_none")]
1389 pub account_holder_name: Option<String>,
1390 pub account_number: String,
1392 pub bank_code: String,
1394 pub branch_code: String,
1396 #[serde(skip_serializing_if = "Option::is_none")]
1397 pub reference: Option<String>,
1398 pub suffix: String,
1400}
1401impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1402 pub fn new(
1403 account_number: impl Into<String>,
1404 bank_code: impl Into<String>,
1405 branch_code: impl Into<String>,
1406 suffix: impl Into<String>,
1407 ) -> Self {
1408 Self {
1409 account_holder_name: None,
1410 account_number: account_number.into(),
1411 bank_code: bank_code.into(),
1412 branch_code: branch_code.into(),
1413 reference: None,
1414 suffix: suffix.into(),
1415 }
1416 }
1417}
1418#[derive(Clone, Debug, serde::Serialize)]
1420pub struct CreateSetupIntentPaymentMethodDataP24 {
1421 #[serde(skip_serializing_if = "Option::is_none")]
1423 pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1424}
1425impl CreateSetupIntentPaymentMethodDataP24 {
1426 pub fn new() -> Self {
1427 Self { bank: None }
1428 }
1429}
1430impl Default for CreateSetupIntentPaymentMethodDataP24 {
1431 fn default() -> Self {
1432 Self::new()
1433 }
1434}
1435#[derive(Clone, Eq, PartialEq)]
1437#[non_exhaustive]
1438pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1439 AliorBank,
1440 BankMillennium,
1441 BankNowyBfgSa,
1442 BankPekaoSa,
1443 BankiSpbdzielcze,
1444 Blik,
1445 BnpParibas,
1446 Boz,
1447 CitiHandlowy,
1448 CreditAgricole,
1449 Envelobank,
1450 EtransferPocztowy24,
1451 GetinBank,
1452 Ideabank,
1453 Ing,
1454 Inteligo,
1455 MbankMtransfer,
1456 NestPrzelew,
1457 NoblePay,
1458 PbacZIpko,
1459 PlusBank,
1460 SantanderPrzelew24,
1461 TmobileUsbugiBankowe,
1462 ToyotaBank,
1463 Velobank,
1464 VolkswagenBank,
1465 Unknown(String),
1467}
1468impl CreateSetupIntentPaymentMethodDataP24Bank {
1469 pub fn as_str(&self) -> &str {
1470 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1471 match self {
1472 AliorBank => "alior_bank",
1473 BankMillennium => "bank_millennium",
1474 BankNowyBfgSa => "bank_nowy_bfg_sa",
1475 BankPekaoSa => "bank_pekao_sa",
1476 BankiSpbdzielcze => "banki_spbdzielcze",
1477 Blik => "blik",
1478 BnpParibas => "bnp_paribas",
1479 Boz => "boz",
1480 CitiHandlowy => "citi_handlowy",
1481 CreditAgricole => "credit_agricole",
1482 Envelobank => "envelobank",
1483 EtransferPocztowy24 => "etransfer_pocztowy24",
1484 GetinBank => "getin_bank",
1485 Ideabank => "ideabank",
1486 Ing => "ing",
1487 Inteligo => "inteligo",
1488 MbankMtransfer => "mbank_mtransfer",
1489 NestPrzelew => "nest_przelew",
1490 NoblePay => "noble_pay",
1491 PbacZIpko => "pbac_z_ipko",
1492 PlusBank => "plus_bank",
1493 SantanderPrzelew24 => "santander_przelew24",
1494 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1495 ToyotaBank => "toyota_bank",
1496 Velobank => "velobank",
1497 VolkswagenBank => "volkswagen_bank",
1498 Unknown(v) => v,
1499 }
1500 }
1501}
1502
1503impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1504 type Err = std::convert::Infallible;
1505 fn from_str(s: &str) -> Result<Self, Self::Err> {
1506 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1507 match s {
1508 "alior_bank" => Ok(AliorBank),
1509 "bank_millennium" => Ok(BankMillennium),
1510 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1511 "bank_pekao_sa" => Ok(BankPekaoSa),
1512 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1513 "blik" => Ok(Blik),
1514 "bnp_paribas" => Ok(BnpParibas),
1515 "boz" => Ok(Boz),
1516 "citi_handlowy" => Ok(CitiHandlowy),
1517 "credit_agricole" => Ok(CreditAgricole),
1518 "envelobank" => Ok(Envelobank),
1519 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1520 "getin_bank" => Ok(GetinBank),
1521 "ideabank" => Ok(Ideabank),
1522 "ing" => Ok(Ing),
1523 "inteligo" => Ok(Inteligo),
1524 "mbank_mtransfer" => Ok(MbankMtransfer),
1525 "nest_przelew" => Ok(NestPrzelew),
1526 "noble_pay" => Ok(NoblePay),
1527 "pbac_z_ipko" => Ok(PbacZIpko),
1528 "plus_bank" => Ok(PlusBank),
1529 "santander_przelew24" => Ok(SantanderPrzelew24),
1530 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1531 "toyota_bank" => Ok(ToyotaBank),
1532 "velobank" => Ok(Velobank),
1533 "volkswagen_bank" => Ok(VolkswagenBank),
1534 v => Ok(Unknown(v.to_owned())),
1535 }
1536 }
1537}
1538impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1539 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1540 f.write_str(self.as_str())
1541 }
1542}
1543
1544impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1545 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1546 f.write_str(self.as_str())
1547 }
1548}
1549impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1550 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1551 where
1552 S: serde::Serializer,
1553 {
1554 serializer.serialize_str(self.as_str())
1555 }
1556}
1557#[cfg(feature = "deserialize")]
1558impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1559 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1560 use std::str::FromStr;
1561 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1562 Ok(Self::from_str(&s).unwrap())
1563 }
1564}
1565#[derive(Clone, Debug, serde::Serialize)]
1567pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1568 pub iban: String,
1570}
1571impl CreateSetupIntentPaymentMethodDataSepaDebit {
1572 pub fn new(iban: impl Into<String>) -> Self {
1573 Self { iban: iban.into() }
1574 }
1575}
1576#[derive(Copy, Clone, Debug, serde::Serialize)]
1578pub struct CreateSetupIntentPaymentMethodDataSofort {
1579 pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1581}
1582impl CreateSetupIntentPaymentMethodDataSofort {
1583 pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1584 Self { country: country.into() }
1585 }
1586}
1587#[derive(Copy, Clone, Eq, PartialEq)]
1589pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1590 At,
1591 Be,
1592 De,
1593 Es,
1594 It,
1595 Nl,
1596}
1597impl CreateSetupIntentPaymentMethodDataSofortCountry {
1598 pub fn as_str(self) -> &'static str {
1599 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1600 match self {
1601 At => "AT",
1602 Be => "BE",
1603 De => "DE",
1604 Es => "ES",
1605 It => "IT",
1606 Nl => "NL",
1607 }
1608 }
1609}
1610
1611impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1612 type Err = stripe_types::StripeParseError;
1613 fn from_str(s: &str) -> Result<Self, Self::Err> {
1614 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1615 match s {
1616 "AT" => Ok(At),
1617 "BE" => Ok(Be),
1618 "DE" => Ok(De),
1619 "ES" => Ok(Es),
1620 "IT" => Ok(It),
1621 "NL" => Ok(Nl),
1622 _ => Err(stripe_types::StripeParseError),
1623 }
1624 }
1625}
1626impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
1627 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1628 f.write_str(self.as_str())
1629 }
1630}
1631
1632impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
1633 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1634 f.write_str(self.as_str())
1635 }
1636}
1637impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
1638 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1639 where
1640 S: serde::Serializer,
1641 {
1642 serializer.serialize_str(self.as_str())
1643 }
1644}
1645#[cfg(feature = "deserialize")]
1646impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
1647 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1648 use std::str::FromStr;
1649 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1650 Self::from_str(&s).map_err(|_| {
1651 serde::de::Error::custom(
1652 "Unknown value for CreateSetupIntentPaymentMethodDataSofortCountry",
1653 )
1654 })
1655 }
1656}
1657#[derive(Clone, Eq, PartialEq)]
1661#[non_exhaustive]
1662pub enum CreateSetupIntentPaymentMethodDataType {
1663 AcssDebit,
1664 Affirm,
1665 AfterpayClearpay,
1666 Alipay,
1667 Alma,
1668 AmazonPay,
1669 AuBecsDebit,
1670 BacsDebit,
1671 Bancontact,
1672 Billie,
1673 Blik,
1674 Boleto,
1675 Cashapp,
1676 Crypto,
1677 CustomerBalance,
1678 Eps,
1679 Fpx,
1680 Giropay,
1681 Grabpay,
1682 Ideal,
1683 KakaoPay,
1684 Klarna,
1685 Konbini,
1686 KrCard,
1687 Link,
1688 MbWay,
1689 Mobilepay,
1690 Multibanco,
1691 NaverPay,
1692 NzBankAccount,
1693 Oxxo,
1694 P24,
1695 PayByBank,
1696 Payco,
1697 Paynow,
1698 Paypal,
1699 Pix,
1700 Promptpay,
1701 RevolutPay,
1702 SamsungPay,
1703 Satispay,
1704 SepaDebit,
1705 Sofort,
1706 Swish,
1707 Twint,
1708 UsBankAccount,
1709 WechatPay,
1710 Zip,
1711 Unknown(String),
1713}
1714impl CreateSetupIntentPaymentMethodDataType {
1715 pub fn as_str(&self) -> &str {
1716 use CreateSetupIntentPaymentMethodDataType::*;
1717 match self {
1718 AcssDebit => "acss_debit",
1719 Affirm => "affirm",
1720 AfterpayClearpay => "afterpay_clearpay",
1721 Alipay => "alipay",
1722 Alma => "alma",
1723 AmazonPay => "amazon_pay",
1724 AuBecsDebit => "au_becs_debit",
1725 BacsDebit => "bacs_debit",
1726 Bancontact => "bancontact",
1727 Billie => "billie",
1728 Blik => "blik",
1729 Boleto => "boleto",
1730 Cashapp => "cashapp",
1731 Crypto => "crypto",
1732 CustomerBalance => "customer_balance",
1733 Eps => "eps",
1734 Fpx => "fpx",
1735 Giropay => "giropay",
1736 Grabpay => "grabpay",
1737 Ideal => "ideal",
1738 KakaoPay => "kakao_pay",
1739 Klarna => "klarna",
1740 Konbini => "konbini",
1741 KrCard => "kr_card",
1742 Link => "link",
1743 MbWay => "mb_way",
1744 Mobilepay => "mobilepay",
1745 Multibanco => "multibanco",
1746 NaverPay => "naver_pay",
1747 NzBankAccount => "nz_bank_account",
1748 Oxxo => "oxxo",
1749 P24 => "p24",
1750 PayByBank => "pay_by_bank",
1751 Payco => "payco",
1752 Paynow => "paynow",
1753 Paypal => "paypal",
1754 Pix => "pix",
1755 Promptpay => "promptpay",
1756 RevolutPay => "revolut_pay",
1757 SamsungPay => "samsung_pay",
1758 Satispay => "satispay",
1759 SepaDebit => "sepa_debit",
1760 Sofort => "sofort",
1761 Swish => "swish",
1762 Twint => "twint",
1763 UsBankAccount => "us_bank_account",
1764 WechatPay => "wechat_pay",
1765 Zip => "zip",
1766 Unknown(v) => v,
1767 }
1768 }
1769}
1770
1771impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
1772 type Err = std::convert::Infallible;
1773 fn from_str(s: &str) -> Result<Self, Self::Err> {
1774 use CreateSetupIntentPaymentMethodDataType::*;
1775 match s {
1776 "acss_debit" => Ok(AcssDebit),
1777 "affirm" => Ok(Affirm),
1778 "afterpay_clearpay" => Ok(AfterpayClearpay),
1779 "alipay" => Ok(Alipay),
1780 "alma" => Ok(Alma),
1781 "amazon_pay" => Ok(AmazonPay),
1782 "au_becs_debit" => Ok(AuBecsDebit),
1783 "bacs_debit" => Ok(BacsDebit),
1784 "bancontact" => Ok(Bancontact),
1785 "billie" => Ok(Billie),
1786 "blik" => Ok(Blik),
1787 "boleto" => Ok(Boleto),
1788 "cashapp" => Ok(Cashapp),
1789 "crypto" => Ok(Crypto),
1790 "customer_balance" => Ok(CustomerBalance),
1791 "eps" => Ok(Eps),
1792 "fpx" => Ok(Fpx),
1793 "giropay" => Ok(Giropay),
1794 "grabpay" => Ok(Grabpay),
1795 "ideal" => Ok(Ideal),
1796 "kakao_pay" => Ok(KakaoPay),
1797 "klarna" => Ok(Klarna),
1798 "konbini" => Ok(Konbini),
1799 "kr_card" => Ok(KrCard),
1800 "link" => Ok(Link),
1801 "mb_way" => Ok(MbWay),
1802 "mobilepay" => Ok(Mobilepay),
1803 "multibanco" => Ok(Multibanco),
1804 "naver_pay" => Ok(NaverPay),
1805 "nz_bank_account" => Ok(NzBankAccount),
1806 "oxxo" => Ok(Oxxo),
1807 "p24" => Ok(P24),
1808 "pay_by_bank" => Ok(PayByBank),
1809 "payco" => Ok(Payco),
1810 "paynow" => Ok(Paynow),
1811 "paypal" => Ok(Paypal),
1812 "pix" => Ok(Pix),
1813 "promptpay" => Ok(Promptpay),
1814 "revolut_pay" => Ok(RevolutPay),
1815 "samsung_pay" => Ok(SamsungPay),
1816 "satispay" => Ok(Satispay),
1817 "sepa_debit" => Ok(SepaDebit),
1818 "sofort" => Ok(Sofort),
1819 "swish" => Ok(Swish),
1820 "twint" => Ok(Twint),
1821 "us_bank_account" => Ok(UsBankAccount),
1822 "wechat_pay" => Ok(WechatPay),
1823 "zip" => Ok(Zip),
1824 v => Ok(Unknown(v.to_owned())),
1825 }
1826 }
1827}
1828impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
1829 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1830 f.write_str(self.as_str())
1831 }
1832}
1833
1834impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
1835 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1836 f.write_str(self.as_str())
1837 }
1838}
1839impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
1840 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1841 where
1842 S: serde::Serializer,
1843 {
1844 serializer.serialize_str(self.as_str())
1845 }
1846}
1847#[cfg(feature = "deserialize")]
1848impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
1849 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1850 use std::str::FromStr;
1851 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1852 Ok(Self::from_str(&s).unwrap())
1853 }
1854}
1855#[derive(Clone, Debug, serde::Serialize)]
1857pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
1858 #[serde(skip_serializing_if = "Option::is_none")]
1860 pub account_holder_type:
1861 Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
1862 #[serde(skip_serializing_if = "Option::is_none")]
1864 pub account_number: Option<String>,
1865 #[serde(skip_serializing_if = "Option::is_none")]
1867 pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
1868 #[serde(skip_serializing_if = "Option::is_none")]
1870 pub financial_connections_account: Option<String>,
1871 #[serde(skip_serializing_if = "Option::is_none")]
1873 pub routing_number: Option<String>,
1874}
1875impl CreateSetupIntentPaymentMethodDataUsBankAccount {
1876 pub fn new() -> Self {
1877 Self {
1878 account_holder_type: None,
1879 account_number: None,
1880 account_type: None,
1881 financial_connections_account: None,
1882 routing_number: None,
1883 }
1884 }
1885}
1886impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
1887 fn default() -> Self {
1888 Self::new()
1889 }
1890}
1891#[derive(Copy, Clone, Eq, PartialEq)]
1893pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1894 Company,
1895 Individual,
1896}
1897impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1898 pub fn as_str(self) -> &'static str {
1899 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1900 match self {
1901 Company => "company",
1902 Individual => "individual",
1903 }
1904 }
1905}
1906
1907impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1908 type Err = stripe_types::StripeParseError;
1909 fn from_str(s: &str) -> Result<Self, Self::Err> {
1910 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1911 match s {
1912 "company" => Ok(Company),
1913 "individual" => Ok(Individual),
1914 _ => Err(stripe_types::StripeParseError),
1915 }
1916 }
1917}
1918impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1919 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1920 f.write_str(self.as_str())
1921 }
1922}
1923
1924impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1925 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1926 f.write_str(self.as_str())
1927 }
1928}
1929impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1930 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1931 where
1932 S: serde::Serializer,
1933 {
1934 serializer.serialize_str(self.as_str())
1935 }
1936}
1937#[cfg(feature = "deserialize")]
1938impl<'de> serde::Deserialize<'de>
1939 for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
1940{
1941 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1942 use std::str::FromStr;
1943 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1944 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
1945 }
1946}
1947#[derive(Copy, Clone, Eq, PartialEq)]
1949pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1950 Checking,
1951 Savings,
1952}
1953impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1954 pub fn as_str(self) -> &'static str {
1955 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1956 match self {
1957 Checking => "checking",
1958 Savings => "savings",
1959 }
1960 }
1961}
1962
1963impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1964 type Err = stripe_types::StripeParseError;
1965 fn from_str(s: &str) -> Result<Self, Self::Err> {
1966 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1967 match s {
1968 "checking" => Ok(Checking),
1969 "savings" => Ok(Savings),
1970 _ => Err(stripe_types::StripeParseError),
1971 }
1972 }
1973}
1974impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1975 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1976 f.write_str(self.as_str())
1977 }
1978}
1979
1980impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1981 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1982 f.write_str(self.as_str())
1983 }
1984}
1985impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1986 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1987 where
1988 S: serde::Serializer,
1989 {
1990 serializer.serialize_str(self.as_str())
1991 }
1992}
1993#[cfg(feature = "deserialize")]
1994impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1995 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1996 use std::str::FromStr;
1997 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1998 Self::from_str(&s).map_err(|_| {
1999 serde::de::Error::custom(
2000 "Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType",
2001 )
2002 })
2003 }
2004}
2005#[derive(Clone, Debug, serde::Serialize)]
2007pub struct CreateSetupIntentPaymentMethodOptions {
2008 #[serde(skip_serializing_if = "Option::is_none")]
2010 pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2011 #[serde(skip_serializing_if = "Option::is_none")]
2013 #[serde(with = "stripe_types::with_serde_json_opt")]
2014 pub amazon_pay: Option<miniserde::json::Value>,
2015 #[serde(skip_serializing_if = "Option::is_none")]
2017 pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2018 #[serde(skip_serializing_if = "Option::is_none")]
2020 pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2021 #[serde(skip_serializing_if = "Option::is_none")]
2023 #[serde(with = "stripe_types::with_serde_json_opt")]
2024 pub card_present: Option<miniserde::json::Value>,
2025 #[serde(skip_serializing_if = "Option::is_none")]
2027 pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2028 #[serde(skip_serializing_if = "Option::is_none")]
2030 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2031 #[serde(skip_serializing_if = "Option::is_none")]
2033 pub paypal: Option<PaymentMethodOptionsParam>,
2034 #[serde(skip_serializing_if = "Option::is_none")]
2036 pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2037 #[serde(skip_serializing_if = "Option::is_none")]
2039 pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2040}
2041impl CreateSetupIntentPaymentMethodOptions {
2042 pub fn new() -> Self {
2043 Self {
2044 acss_debit: None,
2045 amazon_pay: None,
2046 bacs_debit: None,
2047 card: None,
2048 card_present: None,
2049 klarna: None,
2050 link: None,
2051 paypal: None,
2052 sepa_debit: None,
2053 us_bank_account: None,
2054 }
2055 }
2056}
2057impl Default for CreateSetupIntentPaymentMethodOptions {
2058 fn default() -> Self {
2059 Self::new()
2060 }
2061}
2062#[derive(Clone, Debug, serde::Serialize)]
2064pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2065 #[serde(skip_serializing_if = "Option::is_none")]
2068 pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2069 #[serde(skip_serializing_if = "Option::is_none")]
2071 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2072 #[serde(skip_serializing_if = "Option::is_none")]
2074 pub verification_method:
2075 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2076}
2077impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2078 pub fn new() -> Self {
2079 Self { currency: None, mandate_options: None, verification_method: None }
2080 }
2081}
2082impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2083 fn default() -> Self {
2084 Self::new()
2085 }
2086}
2087#[derive(Copy, Clone, Eq, PartialEq)]
2090pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2091 Cad,
2092 Usd,
2093}
2094impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2095 pub fn as_str(self) -> &'static str {
2096 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2097 match self {
2098 Cad => "cad",
2099 Usd => "usd",
2100 }
2101 }
2102}
2103
2104impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2105 type Err = stripe_types::StripeParseError;
2106 fn from_str(s: &str) -> Result<Self, Self::Err> {
2107 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2108 match s {
2109 "cad" => Ok(Cad),
2110 "usd" => Ok(Usd),
2111 _ => Err(stripe_types::StripeParseError),
2112 }
2113 }
2114}
2115impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2116 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2117 f.write_str(self.as_str())
2118 }
2119}
2120
2121impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2122 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2123 f.write_str(self.as_str())
2124 }
2125}
2126impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2127 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2128 where
2129 S: serde::Serializer,
2130 {
2131 serializer.serialize_str(self.as_str())
2132 }
2133}
2134#[cfg(feature = "deserialize")]
2135impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2136 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2137 use std::str::FromStr;
2138 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2139 Self::from_str(&s).map_err(|_| {
2140 serde::de::Error::custom(
2141 "Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
2142 )
2143 })
2144 }
2145}
2146#[derive(Clone, Debug, serde::Serialize)]
2148pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2149 #[serde(skip_serializing_if = "Option::is_none")]
2153 pub custom_mandate_url: Option<String>,
2154 #[serde(skip_serializing_if = "Option::is_none")]
2156 pub default_for:
2157 Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2158 #[serde(skip_serializing_if = "Option::is_none")]
2161 pub interval_description: Option<String>,
2162 #[serde(skip_serializing_if = "Option::is_none")]
2164 pub payment_schedule:
2165 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2166 #[serde(skip_serializing_if = "Option::is_none")]
2168 pub transaction_type:
2169 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2170}
2171impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2172 pub fn new() -> Self {
2173 Self {
2174 custom_mandate_url: None,
2175 default_for: None,
2176 interval_description: None,
2177 payment_schedule: None,
2178 transaction_type: None,
2179 }
2180 }
2181}
2182impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2183 fn default() -> Self {
2184 Self::new()
2185 }
2186}
2187#[derive(Copy, Clone, Eq, PartialEq)]
2189pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2190 Invoice,
2191 Subscription,
2192}
2193impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2194 pub fn as_str(self) -> &'static str {
2195 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2196 match self {
2197 Invoice => "invoice",
2198 Subscription => "subscription",
2199 }
2200 }
2201}
2202
2203impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2204 type Err = stripe_types::StripeParseError;
2205 fn from_str(s: &str) -> Result<Self, Self::Err> {
2206 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2207 match s {
2208 "invoice" => Ok(Invoice),
2209 "subscription" => Ok(Subscription),
2210 _ => Err(stripe_types::StripeParseError),
2211 }
2212 }
2213}
2214impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2215 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2216 f.write_str(self.as_str())
2217 }
2218}
2219
2220impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2221 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2222 f.write_str(self.as_str())
2223 }
2224}
2225impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2226 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2227 where
2228 S: serde::Serializer,
2229 {
2230 serializer.serialize_str(self.as_str())
2231 }
2232}
2233#[cfg(feature = "deserialize")]
2234impl<'de> serde::Deserialize<'de>
2235 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2236{
2237 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2238 use std::str::FromStr;
2239 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2240 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
2241 }
2242}
2243#[derive(Copy, Clone, Eq, PartialEq)]
2245pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2246 Combined,
2247 Interval,
2248 Sporadic,
2249}
2250impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2251 pub fn as_str(self) -> &'static str {
2252 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2253 match self {
2254 Combined => "combined",
2255 Interval => "interval",
2256 Sporadic => "sporadic",
2257 }
2258 }
2259}
2260
2261impl std::str::FromStr
2262 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2263{
2264 type Err = stripe_types::StripeParseError;
2265 fn from_str(s: &str) -> Result<Self, Self::Err> {
2266 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2267 match s {
2268 "combined" => Ok(Combined),
2269 "interval" => Ok(Interval),
2270 "sporadic" => Ok(Sporadic),
2271 _ => Err(stripe_types::StripeParseError),
2272 }
2273 }
2274}
2275impl std::fmt::Display
2276 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2277{
2278 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2279 f.write_str(self.as_str())
2280 }
2281}
2282
2283impl std::fmt::Debug
2284 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2285{
2286 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2287 f.write_str(self.as_str())
2288 }
2289}
2290impl serde::Serialize
2291 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2292{
2293 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2294 where
2295 S: serde::Serializer,
2296 {
2297 serializer.serialize_str(self.as_str())
2298 }
2299}
2300#[cfg(feature = "deserialize")]
2301impl<'de> serde::Deserialize<'de>
2302 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2303{
2304 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2305 use std::str::FromStr;
2306 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2307 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2308 }
2309}
2310#[derive(Copy, Clone, Eq, PartialEq)]
2312pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2313 Business,
2314 Personal,
2315}
2316impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2317 pub fn as_str(self) -> &'static str {
2318 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2319 match self {
2320 Business => "business",
2321 Personal => "personal",
2322 }
2323 }
2324}
2325
2326impl std::str::FromStr
2327 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2328{
2329 type Err = stripe_types::StripeParseError;
2330 fn from_str(s: &str) -> Result<Self, Self::Err> {
2331 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2332 match s {
2333 "business" => Ok(Business),
2334 "personal" => Ok(Personal),
2335 _ => Err(stripe_types::StripeParseError),
2336 }
2337 }
2338}
2339impl std::fmt::Display
2340 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2341{
2342 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2343 f.write_str(self.as_str())
2344 }
2345}
2346
2347impl std::fmt::Debug
2348 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2349{
2350 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2351 f.write_str(self.as_str())
2352 }
2353}
2354impl serde::Serialize
2355 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2356{
2357 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2358 where
2359 S: serde::Serializer,
2360 {
2361 serializer.serialize_str(self.as_str())
2362 }
2363}
2364#[cfg(feature = "deserialize")]
2365impl<'de> serde::Deserialize<'de>
2366 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2367{
2368 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2369 use std::str::FromStr;
2370 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2371 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2372 }
2373}
2374#[derive(Copy, Clone, Eq, PartialEq)]
2376pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2377 Automatic,
2378 Instant,
2379 Microdeposits,
2380}
2381impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2382 pub fn as_str(self) -> &'static str {
2383 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2384 match self {
2385 Automatic => "automatic",
2386 Instant => "instant",
2387 Microdeposits => "microdeposits",
2388 }
2389 }
2390}
2391
2392impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2393 type Err = stripe_types::StripeParseError;
2394 fn from_str(s: &str) -> Result<Self, Self::Err> {
2395 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2396 match s {
2397 "automatic" => Ok(Automatic),
2398 "instant" => Ok(Instant),
2399 "microdeposits" => Ok(Microdeposits),
2400 _ => Err(stripe_types::StripeParseError),
2401 }
2402 }
2403}
2404impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2405 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2406 f.write_str(self.as_str())
2407 }
2408}
2409
2410impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2411 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2412 f.write_str(self.as_str())
2413 }
2414}
2415impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2416 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2417 where
2418 S: serde::Serializer,
2419 {
2420 serializer.serialize_str(self.as_str())
2421 }
2422}
2423#[cfg(feature = "deserialize")]
2424impl<'de> serde::Deserialize<'de>
2425 for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
2426{
2427 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2428 use std::str::FromStr;
2429 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2430 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
2431 }
2432}
2433#[derive(Clone, Debug, serde::Serialize)]
2435pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
2436 #[serde(skip_serializing_if = "Option::is_none")]
2438 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
2439}
2440impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
2441 pub fn new() -> Self {
2442 Self { mandate_options: None }
2443 }
2444}
2445impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
2446 fn default() -> Self {
2447 Self::new()
2448 }
2449}
2450#[derive(Clone, Debug, serde::Serialize)]
2452pub struct CreateSetupIntentPaymentMethodOptionsCard {
2453 #[serde(skip_serializing_if = "Option::is_none")]
2455 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
2456 #[serde(skip_serializing_if = "Option::is_none")]
2460 pub moto: Option<bool>,
2461 #[serde(skip_serializing_if = "Option::is_none")]
2465 pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
2466 #[serde(skip_serializing_if = "Option::is_none")]
2471 pub request_three_d_secure:
2472 Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
2473 #[serde(skip_serializing_if = "Option::is_none")]
2476 pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
2477}
2478impl CreateSetupIntentPaymentMethodOptionsCard {
2479 pub fn new() -> Self {
2480 Self {
2481 mandate_options: None,
2482 moto: None,
2483 network: None,
2484 request_three_d_secure: None,
2485 three_d_secure: None,
2486 }
2487 }
2488}
2489impl Default for CreateSetupIntentPaymentMethodOptionsCard {
2490 fn default() -> Self {
2491 Self::new()
2492 }
2493}
2494#[derive(Clone, Debug, serde::Serialize)]
2496pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2497 pub amount: i64,
2499 pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
2503 pub currency: stripe_types::Currency,
2507 #[serde(skip_serializing_if = "Option::is_none")]
2509 pub description: Option<String>,
2510 #[serde(skip_serializing_if = "Option::is_none")]
2514 pub end_date: Option<stripe_types::Timestamp>,
2515 pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
2517 #[serde(skip_serializing_if = "Option::is_none")]
2522 pub interval_count: Option<u64>,
2523 pub reference: String,
2525 pub start_date: stripe_types::Timestamp,
2527 #[serde(skip_serializing_if = "Option::is_none")]
2529 pub supported_types:
2530 Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
2531}
2532impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2533 pub fn new(
2534 amount: impl Into<i64>,
2535 amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
2536 currency: impl Into<stripe_types::Currency>,
2537 interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
2538 reference: impl Into<String>,
2539 start_date: impl Into<stripe_types::Timestamp>,
2540 ) -> Self {
2541 Self {
2542 amount: amount.into(),
2543 amount_type: amount_type.into(),
2544 currency: currency.into(),
2545 description: None,
2546 end_date: None,
2547 interval: interval.into(),
2548 interval_count: None,
2549 reference: reference.into(),
2550 start_date: start_date.into(),
2551 supported_types: None,
2552 }
2553 }
2554}
2555#[derive(Copy, Clone, Eq, PartialEq)]
2559pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2560 Fixed,
2561 Maximum,
2562}
2563impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2564 pub fn as_str(self) -> &'static str {
2565 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2566 match self {
2567 Fixed => "fixed",
2568 Maximum => "maximum",
2569 }
2570 }
2571}
2572
2573impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2574 type Err = stripe_types::StripeParseError;
2575 fn from_str(s: &str) -> Result<Self, Self::Err> {
2576 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2577 match s {
2578 "fixed" => Ok(Fixed),
2579 "maximum" => Ok(Maximum),
2580 _ => Err(stripe_types::StripeParseError),
2581 }
2582 }
2583}
2584impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2585 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2586 f.write_str(self.as_str())
2587 }
2588}
2589
2590impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2591 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2592 f.write_str(self.as_str())
2593 }
2594}
2595impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2596 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2597 where
2598 S: serde::Serializer,
2599 {
2600 serializer.serialize_str(self.as_str())
2601 }
2602}
2603#[cfg(feature = "deserialize")]
2604impl<'de> serde::Deserialize<'de>
2605 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
2606{
2607 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2608 use std::str::FromStr;
2609 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2610 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
2611 }
2612}
2613#[derive(Copy, Clone, Eq, PartialEq)]
2615pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2616 Day,
2617 Month,
2618 Sporadic,
2619 Week,
2620 Year,
2621}
2622impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2623 pub fn as_str(self) -> &'static str {
2624 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2625 match self {
2626 Day => "day",
2627 Month => "month",
2628 Sporadic => "sporadic",
2629 Week => "week",
2630 Year => "year",
2631 }
2632 }
2633}
2634
2635impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2636 type Err = stripe_types::StripeParseError;
2637 fn from_str(s: &str) -> Result<Self, Self::Err> {
2638 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2639 match s {
2640 "day" => Ok(Day),
2641 "month" => Ok(Month),
2642 "sporadic" => Ok(Sporadic),
2643 "week" => Ok(Week),
2644 "year" => Ok(Year),
2645 _ => Err(stripe_types::StripeParseError),
2646 }
2647 }
2648}
2649impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2650 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2651 f.write_str(self.as_str())
2652 }
2653}
2654
2655impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2656 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2657 f.write_str(self.as_str())
2658 }
2659}
2660impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2661 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2662 where
2663 S: serde::Serializer,
2664 {
2665 serializer.serialize_str(self.as_str())
2666 }
2667}
2668#[cfg(feature = "deserialize")]
2669impl<'de> serde::Deserialize<'de>
2670 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
2671{
2672 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2673 use std::str::FromStr;
2674 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2675 Self::from_str(&s).map_err(|_| {
2676 serde::de::Error::custom(
2677 "Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
2678 )
2679 })
2680 }
2681}
2682#[derive(Copy, Clone, Eq, PartialEq)]
2684pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2685 India,
2686}
2687impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2688 pub fn as_str(self) -> &'static str {
2689 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2690 match self {
2691 India => "india",
2692 }
2693 }
2694}
2695
2696impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2697 type Err = stripe_types::StripeParseError;
2698 fn from_str(s: &str) -> Result<Self, Self::Err> {
2699 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2700 match s {
2701 "india" => Ok(India),
2702 _ => Err(stripe_types::StripeParseError),
2703 }
2704 }
2705}
2706impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2707 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2708 f.write_str(self.as_str())
2709 }
2710}
2711
2712impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2713 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2714 f.write_str(self.as_str())
2715 }
2716}
2717impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2718 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2719 where
2720 S: serde::Serializer,
2721 {
2722 serializer.serialize_str(self.as_str())
2723 }
2724}
2725#[cfg(feature = "deserialize")]
2726impl<'de> serde::Deserialize<'de>
2727 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
2728{
2729 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2730 use std::str::FromStr;
2731 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2732 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
2733 }
2734}
2735#[derive(Copy, Clone, Eq, PartialEq)]
2739pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
2740 Amex,
2741 CartesBancaires,
2742 Diners,
2743 Discover,
2744 EftposAu,
2745 Girocard,
2746 Interac,
2747 Jcb,
2748 Link,
2749 Mastercard,
2750 Unionpay,
2751 Unknown,
2752 Visa,
2753}
2754impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
2755 pub fn as_str(self) -> &'static str {
2756 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2757 match self {
2758 Amex => "amex",
2759 CartesBancaires => "cartes_bancaires",
2760 Diners => "diners",
2761 Discover => "discover",
2762 EftposAu => "eftpos_au",
2763 Girocard => "girocard",
2764 Interac => "interac",
2765 Jcb => "jcb",
2766 Link => "link",
2767 Mastercard => "mastercard",
2768 Unionpay => "unionpay",
2769 Unknown => "unknown",
2770 Visa => "visa",
2771 }
2772 }
2773}
2774
2775impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2776 type Err = stripe_types::StripeParseError;
2777 fn from_str(s: &str) -> Result<Self, Self::Err> {
2778 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2779 match s {
2780 "amex" => Ok(Amex),
2781 "cartes_bancaires" => Ok(CartesBancaires),
2782 "diners" => Ok(Diners),
2783 "discover" => Ok(Discover),
2784 "eftpos_au" => Ok(EftposAu),
2785 "girocard" => Ok(Girocard),
2786 "interac" => Ok(Interac),
2787 "jcb" => Ok(Jcb),
2788 "link" => Ok(Link),
2789 "mastercard" => Ok(Mastercard),
2790 "unionpay" => Ok(Unionpay),
2791 "unknown" => Ok(Unknown),
2792 "visa" => Ok(Visa),
2793 _ => Err(stripe_types::StripeParseError),
2794 }
2795 }
2796}
2797impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2798 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2799 f.write_str(self.as_str())
2800 }
2801}
2802
2803impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2804 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2805 f.write_str(self.as_str())
2806 }
2807}
2808impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2809 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2810 where
2811 S: serde::Serializer,
2812 {
2813 serializer.serialize_str(self.as_str())
2814 }
2815}
2816#[cfg(feature = "deserialize")]
2817impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2818 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2819 use std::str::FromStr;
2820 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2821 Self::from_str(&s).map_err(|_| {
2822 serde::de::Error::custom(
2823 "Unknown value for CreateSetupIntentPaymentMethodOptionsCardNetwork",
2824 )
2825 })
2826 }
2827}
2828#[derive(Copy, Clone, Eq, PartialEq)]
2833pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2834 Any,
2835 Automatic,
2836 Challenge,
2837}
2838impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2839 pub fn as_str(self) -> &'static str {
2840 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2841 match self {
2842 Any => "any",
2843 Automatic => "automatic",
2844 Challenge => "challenge",
2845 }
2846 }
2847}
2848
2849impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2850 type Err = stripe_types::StripeParseError;
2851 fn from_str(s: &str) -> Result<Self, Self::Err> {
2852 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2853 match s {
2854 "any" => Ok(Any),
2855 "automatic" => Ok(Automatic),
2856 "challenge" => Ok(Challenge),
2857 _ => Err(stripe_types::StripeParseError),
2858 }
2859 }
2860}
2861impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2862 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2863 f.write_str(self.as_str())
2864 }
2865}
2866
2867impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2868 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2869 f.write_str(self.as_str())
2870 }
2871}
2872impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2873 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2874 where
2875 S: serde::Serializer,
2876 {
2877 serializer.serialize_str(self.as_str())
2878 }
2879}
2880#[cfg(feature = "deserialize")]
2881impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2882 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2883 use std::str::FromStr;
2884 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2885 Self::from_str(&s).map_err(|_| {
2886 serde::de::Error::custom(
2887 "Unknown value for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
2888 )
2889 })
2890 }
2891}
2892#[derive(Clone, Debug, serde::Serialize)]
2895pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2896 #[serde(skip_serializing_if = "Option::is_none")]
2898 pub ares_trans_status:
2899 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
2900 #[serde(skip_serializing_if = "Option::is_none")]
2905 pub cryptogram: Option<String>,
2906 #[serde(skip_serializing_if = "Option::is_none")]
2909 pub electronic_commerce_indicator:
2910 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
2911 #[serde(skip_serializing_if = "Option::is_none")]
2915 pub network_options:
2916 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
2917 #[serde(skip_serializing_if = "Option::is_none")]
2920 pub requestor_challenge_indicator: Option<String>,
2921 #[serde(skip_serializing_if = "Option::is_none")]
2924 pub transaction_id: Option<String>,
2925 #[serde(skip_serializing_if = "Option::is_none")]
2927 pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
2928}
2929impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2930 pub fn new() -> Self {
2931 Self {
2932 ares_trans_status: None,
2933 cryptogram: None,
2934 electronic_commerce_indicator: None,
2935 network_options: None,
2936 requestor_challenge_indicator: None,
2937 transaction_id: None,
2938 version: None,
2939 }
2940 }
2941}
2942impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2943 fn default() -> Self {
2944 Self::new()
2945 }
2946}
2947#[derive(Copy, Clone, Eq, PartialEq)]
2949pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2950 A,
2951 C,
2952 I,
2953 N,
2954 R,
2955 U,
2956 Y,
2957}
2958impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2959 pub fn as_str(self) -> &'static str {
2960 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2961 match self {
2962 A => "A",
2963 C => "C",
2964 I => "I",
2965 N => "N",
2966 R => "R",
2967 U => "U",
2968 Y => "Y",
2969 }
2970 }
2971}
2972
2973impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2974 type Err = stripe_types::StripeParseError;
2975 fn from_str(s: &str) -> Result<Self, Self::Err> {
2976 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2977 match s {
2978 "A" => Ok(A),
2979 "C" => Ok(C),
2980 "I" => Ok(I),
2981 "N" => Ok(N),
2982 "R" => Ok(R),
2983 "U" => Ok(U),
2984 "Y" => Ok(Y),
2985 _ => Err(stripe_types::StripeParseError),
2986 }
2987 }
2988}
2989impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2990 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2991 f.write_str(self.as_str())
2992 }
2993}
2994
2995impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2996 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2997 f.write_str(self.as_str())
2998 }
2999}
3000impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3001 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3002 where
3003 S: serde::Serializer,
3004 {
3005 serializer.serialize_str(self.as_str())
3006 }
3007}
3008#[cfg(feature = "deserialize")]
3009impl<'de> serde::Deserialize<'de>
3010 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3011{
3012 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3013 use std::str::FromStr;
3014 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3015 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
3016 }
3017}
3018#[derive(Copy, Clone, Eq, PartialEq)]
3021pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3022 V01,
3023 V02,
3024 V05,
3025 V06,
3026 V07,
3027}
3028impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3029 pub fn as_str(self) -> &'static str {
3030 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3031 match self {
3032 V01 => "01",
3033 V02 => "02",
3034 V05 => "05",
3035 V06 => "06",
3036 V07 => "07",
3037 }
3038 }
3039}
3040
3041impl std::str::FromStr
3042 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3043{
3044 type Err = stripe_types::StripeParseError;
3045 fn from_str(s: &str) -> Result<Self, Self::Err> {
3046 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3047 match s {
3048 "01" => Ok(V01),
3049 "02" => Ok(V02),
3050 "05" => Ok(V05),
3051 "06" => Ok(V06),
3052 "07" => Ok(V07),
3053 _ => Err(stripe_types::StripeParseError),
3054 }
3055 }
3056}
3057impl std::fmt::Display
3058 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3059{
3060 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3061 f.write_str(self.as_str())
3062 }
3063}
3064
3065impl std::fmt::Debug
3066 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3067{
3068 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3069 f.write_str(self.as_str())
3070 }
3071}
3072impl serde::Serialize
3073 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3074{
3075 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3076 where
3077 S: serde::Serializer,
3078 {
3079 serializer.serialize_str(self.as_str())
3080 }
3081}
3082#[cfg(feature = "deserialize")]
3083impl<'de> serde::Deserialize<'de>
3084 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3085{
3086 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3087 use std::str::FromStr;
3088 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3089 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
3090 }
3091}
3092#[derive(Clone, Debug, serde::Serialize)]
3096pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3097 #[serde(skip_serializing_if = "Option::is_none")]
3099 pub cartes_bancaires:
3100 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3101}
3102impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3103 pub fn new() -> Self {
3104 Self { cartes_bancaires: None }
3105 }
3106}
3107impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3108 fn default() -> Self {
3109 Self::new()
3110 }
3111}
3112#[derive(Clone, Debug, serde::Serialize)]
3114pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3115 pub cb_avalgo:
3119 CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
3120 #[serde(skip_serializing_if = "Option::is_none")]
3125 pub cb_exemption: Option<String>,
3126 #[serde(skip_serializing_if = "Option::is_none")]
3129 pub cb_score: Option<i64>,
3130}
3131impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3132 pub fn new(
3133 cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
3134 ) -> Self {
3135 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
3136 }
3137}
3138#[derive(Copy, Clone, Eq, PartialEq)]
3142pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3143{
3144 V0,
3145 V1,
3146 V2,
3147 V3,
3148 V4,
3149 A,
3150}
3151impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
3152 pub fn as_str(self) -> &'static str {
3153 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3154 match self {
3155 V0 => "0",
3156 V1 => "1",
3157 V2 => "2",
3158 V3 => "3",
3159 V4 => "4",
3160 A => "A",
3161 }
3162 }
3163}
3164
3165impl std::str::FromStr
3166 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3167{
3168 type Err = stripe_types::StripeParseError;
3169 fn from_str(s: &str) -> Result<Self, Self::Err> {
3170 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3171 match s {
3172 "0" => Ok(V0),
3173 "1" => Ok(V1),
3174 "2" => Ok(V2),
3175 "3" => Ok(V3),
3176 "4" => Ok(V4),
3177 "A" => Ok(A),
3178 _ => Err(stripe_types::StripeParseError),
3179 }
3180 }
3181}
3182impl std::fmt::Display
3183 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3184{
3185 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3186 f.write_str(self.as_str())
3187 }
3188}
3189
3190impl std::fmt::Debug
3191 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3192{
3193 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3194 f.write_str(self.as_str())
3195 }
3196}
3197impl serde::Serialize
3198 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3199{
3200 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3201 where
3202 S: serde::Serializer,
3203 {
3204 serializer.serialize_str(self.as_str())
3205 }
3206}
3207#[cfg(feature = "deserialize")]
3208impl<'de> serde::Deserialize<'de>
3209 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3210{
3211 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3212 use std::str::FromStr;
3213 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3214 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
3215 }
3216}
3217#[derive(Copy, Clone, Eq, PartialEq)]
3219pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3220 V1_0_2,
3221 V2_1_0,
3222 V2_2_0,
3223}
3224impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3225 pub fn as_str(self) -> &'static str {
3226 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3227 match self {
3228 V1_0_2 => "1.0.2",
3229 V2_1_0 => "2.1.0",
3230 V2_2_0 => "2.2.0",
3231 }
3232 }
3233}
3234
3235impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3236 type Err = stripe_types::StripeParseError;
3237 fn from_str(s: &str) -> Result<Self, Self::Err> {
3238 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3239 match s {
3240 "1.0.2" => Ok(V1_0_2),
3241 "2.1.0" => Ok(V2_1_0),
3242 "2.2.0" => Ok(V2_2_0),
3243 _ => Err(stripe_types::StripeParseError),
3244 }
3245 }
3246}
3247impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3248 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3249 f.write_str(self.as_str())
3250 }
3251}
3252
3253impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3254 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3255 f.write_str(self.as_str())
3256 }
3257}
3258impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3259 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3260 where
3261 S: serde::Serializer,
3262 {
3263 serializer.serialize_str(self.as_str())
3264 }
3265}
3266#[cfg(feature = "deserialize")]
3267impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3268 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3269 use std::str::FromStr;
3270 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3271 Self::from_str(&s).map_err(|_| {
3272 serde::de::Error::custom(
3273 "Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
3274 )
3275 })
3276 }
3277}
3278#[derive(Clone, Debug, serde::Serialize)]
3280pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
3281 #[serde(skip_serializing_if = "Option::is_none")]
3283 pub currency: Option<stripe_types::Currency>,
3284 #[serde(skip_serializing_if = "Option::is_none")]
3286 pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
3287 #[serde(skip_serializing_if = "Option::is_none")]
3289 pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
3290 #[serde(skip_serializing_if = "Option::is_none")]
3292 pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
3293}
3294impl CreateSetupIntentPaymentMethodOptionsKlarna {
3295 pub fn new() -> Self {
3296 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
3297 }
3298}
3299impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
3300 fn default() -> Self {
3301 Self::new()
3302 }
3303}
3304#[derive(Copy, Clone, Debug, serde::Serialize)]
3306pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3307 #[serde(skip_serializing_if = "Option::is_none")]
3310 pub average_amount: Option<i64>,
3311 #[serde(skip_serializing_if = "Option::is_none")]
3314 pub maximum_amount: Option<i64>,
3315 #[serde(skip_serializing_if = "Option::is_none")]
3318 pub minimum_amount: Option<i64>,
3319 #[serde(skip_serializing_if = "Option::is_none")]
3321 pub purchase_interval:
3322 Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
3323 #[serde(skip_serializing_if = "Option::is_none")]
3325 pub purchase_interval_count: Option<u64>,
3326}
3327impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3328 pub fn new() -> Self {
3329 Self {
3330 average_amount: None,
3331 maximum_amount: None,
3332 minimum_amount: None,
3333 purchase_interval: None,
3334 purchase_interval_count: None,
3335 }
3336 }
3337}
3338impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3339 fn default() -> Self {
3340 Self::new()
3341 }
3342}
3343#[derive(Copy, Clone, Eq, PartialEq)]
3345pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3346 Day,
3347 Month,
3348 Week,
3349 Year,
3350}
3351impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3352 pub fn as_str(self) -> &'static str {
3353 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3354 match self {
3355 Day => "day",
3356 Month => "month",
3357 Week => "week",
3358 Year => "year",
3359 }
3360 }
3361}
3362
3363impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3364 type Err = stripe_types::StripeParseError;
3365 fn from_str(s: &str) -> Result<Self, Self::Err> {
3366 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3367 match s {
3368 "day" => Ok(Day),
3369 "month" => Ok(Month),
3370 "week" => Ok(Week),
3371 "year" => Ok(Year),
3372 _ => Err(stripe_types::StripeParseError),
3373 }
3374 }
3375}
3376impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3377 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3378 f.write_str(self.as_str())
3379 }
3380}
3381
3382impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3383 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3384 f.write_str(self.as_str())
3385 }
3386}
3387impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3388 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3389 where
3390 S: serde::Serializer,
3391 {
3392 serializer.serialize_str(self.as_str())
3393 }
3394}
3395#[cfg(feature = "deserialize")]
3396impl<'de> serde::Deserialize<'de>
3397 for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
3398{
3399 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3400 use std::str::FromStr;
3401 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3402 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
3403 }
3404}
3405#[derive(Clone, Eq, PartialEq)]
3407#[non_exhaustive]
3408pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3409 CsMinusCz,
3410 DaMinusDk,
3411 DeMinusAt,
3412 DeMinusCh,
3413 DeMinusDe,
3414 ElMinusGr,
3415 EnMinusAt,
3416 EnMinusAu,
3417 EnMinusBe,
3418 EnMinusCa,
3419 EnMinusCh,
3420 EnMinusCz,
3421 EnMinusDe,
3422 EnMinusDk,
3423 EnMinusEs,
3424 EnMinusFi,
3425 EnMinusFr,
3426 EnMinusGb,
3427 EnMinusGr,
3428 EnMinusIe,
3429 EnMinusIt,
3430 EnMinusNl,
3431 EnMinusNo,
3432 EnMinusNz,
3433 EnMinusPl,
3434 EnMinusPt,
3435 EnMinusRo,
3436 EnMinusSe,
3437 EnMinusUs,
3438 EsMinusEs,
3439 EsMinusUs,
3440 FiMinusFi,
3441 FrMinusBe,
3442 FrMinusCa,
3443 FrMinusCh,
3444 FrMinusFr,
3445 ItMinusCh,
3446 ItMinusIt,
3447 NbMinusNo,
3448 NlMinusBe,
3449 NlMinusNl,
3450 PlMinusPl,
3451 PtMinusPt,
3452 RoMinusRo,
3453 SvMinusFi,
3454 SvMinusSe,
3455 Unknown(String),
3457}
3458impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3459 pub fn as_str(&self) -> &str {
3460 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3461 match self {
3462 CsMinusCz => "cs-CZ",
3463 DaMinusDk => "da-DK",
3464 DeMinusAt => "de-AT",
3465 DeMinusCh => "de-CH",
3466 DeMinusDe => "de-DE",
3467 ElMinusGr => "el-GR",
3468 EnMinusAt => "en-AT",
3469 EnMinusAu => "en-AU",
3470 EnMinusBe => "en-BE",
3471 EnMinusCa => "en-CA",
3472 EnMinusCh => "en-CH",
3473 EnMinusCz => "en-CZ",
3474 EnMinusDe => "en-DE",
3475 EnMinusDk => "en-DK",
3476 EnMinusEs => "en-ES",
3477 EnMinusFi => "en-FI",
3478 EnMinusFr => "en-FR",
3479 EnMinusGb => "en-GB",
3480 EnMinusGr => "en-GR",
3481 EnMinusIe => "en-IE",
3482 EnMinusIt => "en-IT",
3483 EnMinusNl => "en-NL",
3484 EnMinusNo => "en-NO",
3485 EnMinusNz => "en-NZ",
3486 EnMinusPl => "en-PL",
3487 EnMinusPt => "en-PT",
3488 EnMinusRo => "en-RO",
3489 EnMinusSe => "en-SE",
3490 EnMinusUs => "en-US",
3491 EsMinusEs => "es-ES",
3492 EsMinusUs => "es-US",
3493 FiMinusFi => "fi-FI",
3494 FrMinusBe => "fr-BE",
3495 FrMinusCa => "fr-CA",
3496 FrMinusCh => "fr-CH",
3497 FrMinusFr => "fr-FR",
3498 ItMinusCh => "it-CH",
3499 ItMinusIt => "it-IT",
3500 NbMinusNo => "nb-NO",
3501 NlMinusBe => "nl-BE",
3502 NlMinusNl => "nl-NL",
3503 PlMinusPl => "pl-PL",
3504 PtMinusPt => "pt-PT",
3505 RoMinusRo => "ro-RO",
3506 SvMinusFi => "sv-FI",
3507 SvMinusSe => "sv-SE",
3508 Unknown(v) => v,
3509 }
3510 }
3511}
3512
3513impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3514 type Err = std::convert::Infallible;
3515 fn from_str(s: &str) -> Result<Self, Self::Err> {
3516 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3517 match s {
3518 "cs-CZ" => Ok(CsMinusCz),
3519 "da-DK" => Ok(DaMinusDk),
3520 "de-AT" => Ok(DeMinusAt),
3521 "de-CH" => Ok(DeMinusCh),
3522 "de-DE" => Ok(DeMinusDe),
3523 "el-GR" => Ok(ElMinusGr),
3524 "en-AT" => Ok(EnMinusAt),
3525 "en-AU" => Ok(EnMinusAu),
3526 "en-BE" => Ok(EnMinusBe),
3527 "en-CA" => Ok(EnMinusCa),
3528 "en-CH" => Ok(EnMinusCh),
3529 "en-CZ" => Ok(EnMinusCz),
3530 "en-DE" => Ok(EnMinusDe),
3531 "en-DK" => Ok(EnMinusDk),
3532 "en-ES" => Ok(EnMinusEs),
3533 "en-FI" => Ok(EnMinusFi),
3534 "en-FR" => Ok(EnMinusFr),
3535 "en-GB" => Ok(EnMinusGb),
3536 "en-GR" => Ok(EnMinusGr),
3537 "en-IE" => Ok(EnMinusIe),
3538 "en-IT" => Ok(EnMinusIt),
3539 "en-NL" => Ok(EnMinusNl),
3540 "en-NO" => Ok(EnMinusNo),
3541 "en-NZ" => Ok(EnMinusNz),
3542 "en-PL" => Ok(EnMinusPl),
3543 "en-PT" => Ok(EnMinusPt),
3544 "en-RO" => Ok(EnMinusRo),
3545 "en-SE" => Ok(EnMinusSe),
3546 "en-US" => Ok(EnMinusUs),
3547 "es-ES" => Ok(EsMinusEs),
3548 "es-US" => Ok(EsMinusUs),
3549 "fi-FI" => Ok(FiMinusFi),
3550 "fr-BE" => Ok(FrMinusBe),
3551 "fr-CA" => Ok(FrMinusCa),
3552 "fr-CH" => Ok(FrMinusCh),
3553 "fr-FR" => Ok(FrMinusFr),
3554 "it-CH" => Ok(ItMinusCh),
3555 "it-IT" => Ok(ItMinusIt),
3556 "nb-NO" => Ok(NbMinusNo),
3557 "nl-BE" => Ok(NlMinusBe),
3558 "nl-NL" => Ok(NlMinusNl),
3559 "pl-PL" => Ok(PlMinusPl),
3560 "pt-PT" => Ok(PtMinusPt),
3561 "ro-RO" => Ok(RoMinusRo),
3562 "sv-FI" => Ok(SvMinusFi),
3563 "sv-SE" => Ok(SvMinusSe),
3564 v => Ok(Unknown(v.to_owned())),
3565 }
3566 }
3567}
3568impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3569 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3570 f.write_str(self.as_str())
3571 }
3572}
3573
3574impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3575 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3576 f.write_str(self.as_str())
3577 }
3578}
3579impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3580 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3581 where
3582 S: serde::Serializer,
3583 {
3584 serializer.serialize_str(self.as_str())
3585 }
3586}
3587#[cfg(feature = "deserialize")]
3588impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3589 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3590 use std::str::FromStr;
3591 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3592 Ok(Self::from_str(&s).unwrap())
3593 }
3594}
3595#[derive(Clone, Debug, serde::Serialize)]
3597pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3598 pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
3600 #[serde(skip_serializing_if = "Option::is_none")]
3603 pub interval_count: Option<u64>,
3604 #[serde(skip_serializing_if = "Option::is_none")]
3606 pub name: Option<String>,
3607 pub next_billing: SubscriptionNextBillingParam,
3609 pub reference: String,
3612}
3613impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3614 pub fn new(
3615 interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
3616 next_billing: impl Into<SubscriptionNextBillingParam>,
3617 reference: impl Into<String>,
3618 ) -> Self {
3619 Self {
3620 interval: interval.into(),
3621 interval_count: None,
3622 name: None,
3623 next_billing: next_billing.into(),
3624 reference: reference.into(),
3625 }
3626 }
3627}
3628#[derive(Copy, Clone, Eq, PartialEq)]
3630pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3631 Day,
3632 Month,
3633 Week,
3634 Year,
3635}
3636impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3637 pub fn as_str(self) -> &'static str {
3638 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3639 match self {
3640 Day => "day",
3641 Month => "month",
3642 Week => "week",
3643 Year => "year",
3644 }
3645 }
3646}
3647
3648impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3649 type Err = stripe_types::StripeParseError;
3650 fn from_str(s: &str) -> Result<Self, Self::Err> {
3651 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3652 match s {
3653 "day" => Ok(Day),
3654 "month" => Ok(Month),
3655 "week" => Ok(Week),
3656 "year" => Ok(Year),
3657 _ => Err(stripe_types::StripeParseError),
3658 }
3659 }
3660}
3661impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3662 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3663 f.write_str(self.as_str())
3664 }
3665}
3666
3667impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3668 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3669 f.write_str(self.as_str())
3670 }
3671}
3672impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3673 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3674 where
3675 S: serde::Serializer,
3676 {
3677 serializer.serialize_str(self.as_str())
3678 }
3679}
3680#[cfg(feature = "deserialize")]
3681impl<'de> serde::Deserialize<'de>
3682 for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
3683{
3684 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3685 use std::str::FromStr;
3686 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3687 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
3688 }
3689}
3690#[derive(Clone, Debug, serde::Serialize)]
3692pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
3693 #[serde(skip_serializing_if = "Option::is_none")]
3695 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
3696}
3697impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
3698 pub fn new() -> Self {
3699 Self { mandate_options: None }
3700 }
3701}
3702impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
3703 fn default() -> Self {
3704 Self::new()
3705 }
3706}
3707#[derive(Clone, Debug, serde::Serialize)]
3709pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3710 #[serde(skip_serializing_if = "Option::is_none")]
3715 pub reference_prefix: Option<String>,
3716}
3717impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3718 pub fn new() -> Self {
3719 Self { reference_prefix: None }
3720 }
3721}
3722impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3723 fn default() -> Self {
3724 Self::new()
3725 }
3726}
3727#[derive(Clone, Debug, serde::Serialize)]
3729pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3730 #[serde(skip_serializing_if = "Option::is_none")]
3732 pub financial_connections:
3733 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
3734 #[serde(skip_serializing_if = "Option::is_none")]
3736 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
3737 #[serde(skip_serializing_if = "Option::is_none")]
3739 pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
3740 #[serde(skip_serializing_if = "Option::is_none")]
3742 pub verification_method:
3743 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
3744}
3745impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3746 pub fn new() -> Self {
3747 Self {
3748 financial_connections: None,
3749 mandate_options: None,
3750 networks: None,
3751 verification_method: None,
3752 }
3753 }
3754}
3755impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3756 fn default() -> Self {
3757 Self::new()
3758 }
3759}
3760#[derive(Clone, Debug, serde::Serialize)]
3762pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3763 #[serde(skip_serializing_if = "Option::is_none")]
3765 pub filters:
3766 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
3767 #[serde(skip_serializing_if = "Option::is_none")]
3771 pub permissions: Option<
3772 Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
3773 >,
3774 #[serde(skip_serializing_if = "Option::is_none")]
3776 pub prefetch:
3777 Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
3778 #[serde(skip_serializing_if = "Option::is_none")]
3781 pub return_url: Option<String>,
3782}
3783impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3784 pub fn new() -> Self {
3785 Self { filters: None, permissions: None, prefetch: None, return_url: None }
3786 }
3787}
3788impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3789 fn default() -> Self {
3790 Self::new()
3791 }
3792}
3793#[derive(Clone, Debug, serde::Serialize)]
3795pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3796 #[serde(skip_serializing_if = "Option::is_none")]
3799pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
3800
3801}
3802impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3803 pub fn new() -> Self {
3804 Self { account_subcategories: None }
3805 }
3806}
3807impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3808 fn default() -> Self {
3809 Self::new()
3810 }
3811}
3812#[derive(Copy, Clone, Eq, PartialEq)]
3815pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
3816{
3817 Checking,
3818 Savings,
3819}
3820impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3821 pub fn as_str(self) -> &'static str {
3822 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3823 match self {
3824Checking => "checking",
3825Savings => "savings",
3826
3827 }
3828 }
3829}
3830
3831impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3832 type Err = stripe_types::StripeParseError;
3833 fn from_str(s: &str) -> Result<Self, Self::Err> {
3834 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3835 match s {
3836 "checking" => Ok(Checking),
3837"savings" => Ok(Savings),
3838_ => Err(stripe_types::StripeParseError)
3839
3840 }
3841 }
3842}
3843impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3844 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3845 f.write_str(self.as_str())
3846 }
3847}
3848
3849impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3850 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3851 f.write_str(self.as_str())
3852 }
3853}
3854impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3855 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
3856 serializer.serialize_str(self.as_str())
3857 }
3858}
3859#[cfg(feature = "deserialize")]
3860impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3861 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3862 use std::str::FromStr;
3863 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3864 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
3865 }
3866}
3867#[derive(Copy, Clone, Eq, PartialEq)]
3871pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3872 Balances,
3873 Ownership,
3874 PaymentMethod,
3875 Transactions,
3876}
3877impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3878 pub fn as_str(self) -> &'static str {
3879 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3880 match self {
3881 Balances => "balances",
3882 Ownership => "ownership",
3883 PaymentMethod => "payment_method",
3884 Transactions => "transactions",
3885 }
3886 }
3887}
3888
3889impl std::str::FromStr
3890 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3891{
3892 type Err = stripe_types::StripeParseError;
3893 fn from_str(s: &str) -> Result<Self, Self::Err> {
3894 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3895 match s {
3896 "balances" => Ok(Balances),
3897 "ownership" => Ok(Ownership),
3898 "payment_method" => Ok(PaymentMethod),
3899 "transactions" => Ok(Transactions),
3900 _ => Err(stripe_types::StripeParseError),
3901 }
3902 }
3903}
3904impl std::fmt::Display
3905 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3906{
3907 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3908 f.write_str(self.as_str())
3909 }
3910}
3911
3912impl std::fmt::Debug
3913 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3914{
3915 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3916 f.write_str(self.as_str())
3917 }
3918}
3919impl serde::Serialize
3920 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3921{
3922 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3923 where
3924 S: serde::Serializer,
3925 {
3926 serializer.serialize_str(self.as_str())
3927 }
3928}
3929#[cfg(feature = "deserialize")]
3930impl<'de> serde::Deserialize<'de>
3931 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3932{
3933 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3934 use std::str::FromStr;
3935 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3936 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
3937 }
3938}
3939#[derive(Copy, Clone, Eq, PartialEq)]
3941pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3942 Balances,
3943 Ownership,
3944 Transactions,
3945}
3946impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3947 pub fn as_str(self) -> &'static str {
3948 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3949 match self {
3950 Balances => "balances",
3951 Ownership => "ownership",
3952 Transactions => "transactions",
3953 }
3954 }
3955}
3956
3957impl std::str::FromStr
3958 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3959{
3960 type Err = stripe_types::StripeParseError;
3961 fn from_str(s: &str) -> Result<Self, Self::Err> {
3962 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3963 match s {
3964 "balances" => Ok(Balances),
3965 "ownership" => Ok(Ownership),
3966 "transactions" => Ok(Transactions),
3967 _ => Err(stripe_types::StripeParseError),
3968 }
3969 }
3970}
3971impl std::fmt::Display
3972 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3973{
3974 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3975 f.write_str(self.as_str())
3976 }
3977}
3978
3979impl std::fmt::Debug
3980 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3981{
3982 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3983 f.write_str(self.as_str())
3984 }
3985}
3986impl serde::Serialize
3987 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3988{
3989 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3990 where
3991 S: serde::Serializer,
3992 {
3993 serializer.serialize_str(self.as_str())
3994 }
3995}
3996#[cfg(feature = "deserialize")]
3997impl<'de> serde::Deserialize<'de>
3998 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3999{
4000 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4001 use std::str::FromStr;
4002 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4003 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
4004 }
4005}
4006#[derive(Copy, Clone, Debug, serde::Serialize)]
4008pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4009 #[serde(skip_serializing_if = "Option::is_none")]
4011 pub collection_method:
4012 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
4013}
4014impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4015 pub fn new() -> Self {
4016 Self { collection_method: None }
4017 }
4018}
4019impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4020 fn default() -> Self {
4021 Self::new()
4022 }
4023}
4024#[derive(Copy, Clone, Eq, PartialEq)]
4026pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4027 Paper,
4028}
4029impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4030 pub fn as_str(self) -> &'static str {
4031 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4032 match self {
4033 Paper => "paper",
4034 }
4035 }
4036}
4037
4038impl std::str::FromStr
4039 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4040{
4041 type Err = stripe_types::StripeParseError;
4042 fn from_str(s: &str) -> Result<Self, Self::Err> {
4043 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4044 match s {
4045 "paper" => Ok(Paper),
4046 _ => Err(stripe_types::StripeParseError),
4047 }
4048 }
4049}
4050impl std::fmt::Display
4051 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4052{
4053 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4054 f.write_str(self.as_str())
4055 }
4056}
4057
4058impl std::fmt::Debug
4059 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4060{
4061 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4062 f.write_str(self.as_str())
4063 }
4064}
4065impl serde::Serialize
4066 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4067{
4068 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4069 where
4070 S: serde::Serializer,
4071 {
4072 serializer.serialize_str(self.as_str())
4073 }
4074}
4075#[cfg(feature = "deserialize")]
4076impl<'de> serde::Deserialize<'de>
4077 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4078{
4079 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4080 use std::str::FromStr;
4081 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4082 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
4083 }
4084}
4085#[derive(Clone, Debug, serde::Serialize)]
4087pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4088 #[serde(skip_serializing_if = "Option::is_none")]
4090 pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
4091}
4092impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4093 pub fn new() -> Self {
4094 Self { requested: None }
4095 }
4096}
4097impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4098 fn default() -> Self {
4099 Self::new()
4100 }
4101}
4102#[derive(Copy, Clone, Eq, PartialEq)]
4104pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4105 Ach,
4106 UsDomesticWire,
4107}
4108impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4109 pub fn as_str(self) -> &'static str {
4110 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4111 match self {
4112 Ach => "ach",
4113 UsDomesticWire => "us_domestic_wire",
4114 }
4115 }
4116}
4117
4118impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4119 type Err = stripe_types::StripeParseError;
4120 fn from_str(s: &str) -> Result<Self, Self::Err> {
4121 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4122 match s {
4123 "ach" => Ok(Ach),
4124 "us_domestic_wire" => Ok(UsDomesticWire),
4125 _ => Err(stripe_types::StripeParseError),
4126 }
4127 }
4128}
4129impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4130 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4131 f.write_str(self.as_str())
4132 }
4133}
4134
4135impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4136 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4137 f.write_str(self.as_str())
4138 }
4139}
4140impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4141 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4142 where
4143 S: serde::Serializer,
4144 {
4145 serializer.serialize_str(self.as_str())
4146 }
4147}
4148#[cfg(feature = "deserialize")]
4149impl<'de> serde::Deserialize<'de>
4150 for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
4151{
4152 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4153 use std::str::FromStr;
4154 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4155 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
4156 }
4157}
4158#[derive(Copy, Clone, Eq, PartialEq)]
4160pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4161 Automatic,
4162 Instant,
4163 Microdeposits,
4164}
4165impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4166 pub fn as_str(self) -> &'static str {
4167 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4168 match self {
4169 Automatic => "automatic",
4170 Instant => "instant",
4171 Microdeposits => "microdeposits",
4172 }
4173 }
4174}
4175
4176impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4177 type Err = stripe_types::StripeParseError;
4178 fn from_str(s: &str) -> Result<Self, Self::Err> {
4179 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4180 match s {
4181 "automatic" => Ok(Automatic),
4182 "instant" => Ok(Instant),
4183 "microdeposits" => Ok(Microdeposits),
4184 _ => Err(stripe_types::StripeParseError),
4185 }
4186 }
4187}
4188impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4189 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4190 f.write_str(self.as_str())
4191 }
4192}
4193
4194impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4195 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4196 f.write_str(self.as_str())
4197 }
4198}
4199impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4200 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4201 where
4202 S: serde::Serializer,
4203 {
4204 serializer.serialize_str(self.as_str())
4205 }
4206}
4207#[cfg(feature = "deserialize")]
4208impl<'de> serde::Deserialize<'de>
4209 for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
4210{
4211 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4212 use std::str::FromStr;
4213 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4214 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
4215 }
4216}
4217#[derive(Clone, Debug, serde::Serialize)]
4221pub struct CreateSetupIntentSingleUse {
4222 pub amount: i64,
4227 pub currency: stripe_types::Currency,
4230}
4231impl CreateSetupIntentSingleUse {
4232 pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
4233 Self { amount: amount.into(), currency: currency.into() }
4234 }
4235}
4236#[derive(Copy, Clone, Eq, PartialEq)]
4239pub enum CreateSetupIntentUsage {
4240 OffSession,
4241 OnSession,
4242}
4243impl CreateSetupIntentUsage {
4244 pub fn as_str(self) -> &'static str {
4245 use CreateSetupIntentUsage::*;
4246 match self {
4247 OffSession => "off_session",
4248 OnSession => "on_session",
4249 }
4250 }
4251}
4252
4253impl std::str::FromStr for CreateSetupIntentUsage {
4254 type Err = stripe_types::StripeParseError;
4255 fn from_str(s: &str) -> Result<Self, Self::Err> {
4256 use CreateSetupIntentUsage::*;
4257 match s {
4258 "off_session" => Ok(OffSession),
4259 "on_session" => Ok(OnSession),
4260 _ => Err(stripe_types::StripeParseError),
4261 }
4262 }
4263}
4264impl std::fmt::Display for CreateSetupIntentUsage {
4265 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4266 f.write_str(self.as_str())
4267 }
4268}
4269
4270impl std::fmt::Debug for CreateSetupIntentUsage {
4271 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4272 f.write_str(self.as_str())
4273 }
4274}
4275impl serde::Serialize for CreateSetupIntentUsage {
4276 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4277 where
4278 S: serde::Serializer,
4279 {
4280 serializer.serialize_str(self.as_str())
4281 }
4282}
4283#[cfg(feature = "deserialize")]
4284impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
4285 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4286 use std::str::FromStr;
4287 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4288 Self::from_str(&s)
4289 .map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentUsage"))
4290 }
4291}
4292#[derive(Clone, Debug, serde::Serialize)]
4297pub struct CreateSetupIntent {
4298 inner: CreateSetupIntentBuilder,
4299}
4300impl CreateSetupIntent {
4301 pub fn new() -> Self {
4303 Self { inner: CreateSetupIntentBuilder::new() }
4304 }
4305 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
4310 self.inner.attach_to_self = Some(attach_to_self.into());
4311 self
4312 }
4313 pub fn automatic_payment_methods(
4315 mut self,
4316 automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
4317 ) -> Self {
4318 self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
4319 self
4320 }
4321 pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
4325 self.inner.confirm = Some(confirm.into());
4326 self
4327 }
4328 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
4332 self.inner.confirmation_token = Some(confirmation_token.into());
4333 self
4334 }
4335 pub fn customer(mut self, customer: impl Into<String>) -> Self {
4340 self.inner.customer = Some(customer.into());
4341 self
4342 }
4343 pub fn description(mut self, description: impl Into<String>) -> Self {
4345 self.inner.description = Some(description.into());
4346 self
4347 }
4348 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4350 self.inner.expand = Some(expand.into());
4351 self
4352 }
4353 pub fn flow_directions(
4359 mut self,
4360 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
4361 ) -> Self {
4362 self.inner.flow_directions = Some(flow_directions.into());
4363 self
4364 }
4365 pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
4368 self.inner.mandate_data = Some(mandate_data.into());
4369 self
4370 }
4371 pub fn metadata(
4376 mut self,
4377 metadata: impl Into<std::collections::HashMap<String, String>>,
4378 ) -> Self {
4379 self.inner.metadata = Some(metadata.into());
4380 self
4381 }
4382 pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
4384 self.inner.on_behalf_of = Some(on_behalf_of.into());
4385 self
4386 }
4387 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
4389 self.inner.payment_method = Some(payment_method.into());
4390 self
4391 }
4392 pub fn payment_method_configuration(
4394 mut self,
4395 payment_method_configuration: impl Into<String>,
4396 ) -> Self {
4397 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
4398 self
4399 }
4400 pub fn payment_method_data(
4403 mut self,
4404 payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
4405 ) -> Self {
4406 self.inner.payment_method_data = Some(payment_method_data.into());
4407 self
4408 }
4409 pub fn payment_method_options(
4411 mut self,
4412 payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
4413 ) -> Self {
4414 self.inner.payment_method_options = Some(payment_method_options.into());
4415 self
4416 }
4417 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
4421 self.inner.payment_method_types = Some(payment_method_types.into());
4422 self
4423 }
4424 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
4428 self.inner.return_url = Some(return_url.into());
4429 self
4430 }
4431 pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
4435 self.inner.single_use = Some(single_use.into());
4436 self
4437 }
4438 pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
4441 self.inner.usage = Some(usage.into());
4442 self
4443 }
4444 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
4446 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
4447 self
4448 }
4449}
4450impl Default for CreateSetupIntent {
4451 fn default() -> Self {
4452 Self::new()
4453 }
4454}
4455impl CreateSetupIntent {
4456 pub async fn send<C: StripeClient>(
4458 &self,
4459 client: &C,
4460 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4461 self.customize().send(client).await
4462 }
4463
4464 pub fn send_blocking<C: StripeBlockingClient>(
4466 &self,
4467 client: &C,
4468 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4469 self.customize().send_blocking(client)
4470 }
4471}
4472
4473impl StripeRequest for CreateSetupIntent {
4474 type Output = stripe_shared::SetupIntent;
4475
4476 fn build(&self) -> RequestBuilder {
4477 RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
4478 }
4479}
4480#[derive(Clone, Debug, serde::Serialize)]
4481struct UpdateSetupIntentBuilder {
4482 #[serde(skip_serializing_if = "Option::is_none")]
4483 attach_to_self: Option<bool>,
4484 #[serde(skip_serializing_if = "Option::is_none")]
4485 customer: Option<String>,
4486 #[serde(skip_serializing_if = "Option::is_none")]
4487 description: Option<String>,
4488 #[serde(skip_serializing_if = "Option::is_none")]
4489 expand: Option<Vec<String>>,
4490 #[serde(skip_serializing_if = "Option::is_none")]
4491 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
4492 #[serde(skip_serializing_if = "Option::is_none")]
4493 metadata: Option<std::collections::HashMap<String, String>>,
4494 #[serde(skip_serializing_if = "Option::is_none")]
4495 payment_method: Option<String>,
4496 #[serde(skip_serializing_if = "Option::is_none")]
4497 payment_method_configuration: Option<String>,
4498 #[serde(skip_serializing_if = "Option::is_none")]
4499 payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
4500 #[serde(skip_serializing_if = "Option::is_none")]
4501 payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
4502 #[serde(skip_serializing_if = "Option::is_none")]
4503 payment_method_types: Option<Vec<String>>,
4504}
4505impl UpdateSetupIntentBuilder {
4506 fn new() -> Self {
4507 Self {
4508 attach_to_self: None,
4509 customer: None,
4510 description: None,
4511 expand: None,
4512 flow_directions: None,
4513 metadata: None,
4514 payment_method: None,
4515 payment_method_configuration: None,
4516 payment_method_data: None,
4517 payment_method_options: None,
4518 payment_method_types: None,
4519 }
4520 }
4521}
4522#[derive(Clone, Debug, serde::Serialize)]
4525pub struct UpdateSetupIntentPaymentMethodData {
4526 #[serde(skip_serializing_if = "Option::is_none")]
4528 pub acss_debit: Option<PaymentMethodParam>,
4529 #[serde(skip_serializing_if = "Option::is_none")]
4531 #[serde(with = "stripe_types::with_serde_json_opt")]
4532 pub affirm: Option<miniserde::json::Value>,
4533 #[serde(skip_serializing_if = "Option::is_none")]
4535 #[serde(with = "stripe_types::with_serde_json_opt")]
4536 pub afterpay_clearpay: Option<miniserde::json::Value>,
4537 #[serde(skip_serializing_if = "Option::is_none")]
4539 #[serde(with = "stripe_types::with_serde_json_opt")]
4540 pub alipay: Option<miniserde::json::Value>,
4541 #[serde(skip_serializing_if = "Option::is_none")]
4545 pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
4546 #[serde(skip_serializing_if = "Option::is_none")]
4548 #[serde(with = "stripe_types::with_serde_json_opt")]
4549 pub alma: Option<miniserde::json::Value>,
4550 #[serde(skip_serializing_if = "Option::is_none")]
4552 #[serde(with = "stripe_types::with_serde_json_opt")]
4553 pub amazon_pay: Option<miniserde::json::Value>,
4554 #[serde(skip_serializing_if = "Option::is_none")]
4556 pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
4557 #[serde(skip_serializing_if = "Option::is_none")]
4559 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
4560 #[serde(skip_serializing_if = "Option::is_none")]
4562 #[serde(with = "stripe_types::with_serde_json_opt")]
4563 pub bancontact: Option<miniserde::json::Value>,
4564 #[serde(skip_serializing_if = "Option::is_none")]
4566 #[serde(with = "stripe_types::with_serde_json_opt")]
4567 pub billie: Option<miniserde::json::Value>,
4568 #[serde(skip_serializing_if = "Option::is_none")]
4570 pub billing_details: Option<BillingDetailsInnerParams>,
4571 #[serde(skip_serializing_if = "Option::is_none")]
4573 #[serde(with = "stripe_types::with_serde_json_opt")]
4574 pub blik: Option<miniserde::json::Value>,
4575 #[serde(skip_serializing_if = "Option::is_none")]
4577 pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
4578 #[serde(skip_serializing_if = "Option::is_none")]
4580 #[serde(with = "stripe_types::with_serde_json_opt")]
4581 pub cashapp: Option<miniserde::json::Value>,
4582 #[serde(skip_serializing_if = "Option::is_none")]
4584 #[serde(with = "stripe_types::with_serde_json_opt")]
4585 pub crypto: Option<miniserde::json::Value>,
4586 #[serde(skip_serializing_if = "Option::is_none")]
4588 #[serde(with = "stripe_types::with_serde_json_opt")]
4589 pub customer_balance: Option<miniserde::json::Value>,
4590 #[serde(skip_serializing_if = "Option::is_none")]
4592 pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
4593 #[serde(skip_serializing_if = "Option::is_none")]
4595 pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
4596 #[serde(skip_serializing_if = "Option::is_none")]
4598 #[serde(with = "stripe_types::with_serde_json_opt")]
4599 pub giropay: Option<miniserde::json::Value>,
4600 #[serde(skip_serializing_if = "Option::is_none")]
4602 #[serde(with = "stripe_types::with_serde_json_opt")]
4603 pub grabpay: Option<miniserde::json::Value>,
4604 #[serde(skip_serializing_if = "Option::is_none")]
4606 pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
4607 #[serde(skip_serializing_if = "Option::is_none")]
4609 #[serde(with = "stripe_types::with_serde_json_opt")]
4610 pub interac_present: Option<miniserde::json::Value>,
4611 #[serde(skip_serializing_if = "Option::is_none")]
4613 #[serde(with = "stripe_types::with_serde_json_opt")]
4614 pub kakao_pay: Option<miniserde::json::Value>,
4615 #[serde(skip_serializing_if = "Option::is_none")]
4617 pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
4618 #[serde(skip_serializing_if = "Option::is_none")]
4620 #[serde(with = "stripe_types::with_serde_json_opt")]
4621 pub konbini: Option<miniserde::json::Value>,
4622 #[serde(skip_serializing_if = "Option::is_none")]
4624 #[serde(with = "stripe_types::with_serde_json_opt")]
4625 pub kr_card: Option<miniserde::json::Value>,
4626 #[serde(skip_serializing_if = "Option::is_none")]
4628 #[serde(with = "stripe_types::with_serde_json_opt")]
4629 pub link: Option<miniserde::json::Value>,
4630 #[serde(skip_serializing_if = "Option::is_none")]
4632 #[serde(with = "stripe_types::with_serde_json_opt")]
4633 pub mb_way: Option<miniserde::json::Value>,
4634 #[serde(skip_serializing_if = "Option::is_none")]
4639 pub metadata: Option<std::collections::HashMap<String, String>>,
4640 #[serde(skip_serializing_if = "Option::is_none")]
4642 #[serde(with = "stripe_types::with_serde_json_opt")]
4643 pub mobilepay: Option<miniserde::json::Value>,
4644 #[serde(skip_serializing_if = "Option::is_none")]
4646 #[serde(with = "stripe_types::with_serde_json_opt")]
4647 pub multibanco: Option<miniserde::json::Value>,
4648 #[serde(skip_serializing_if = "Option::is_none")]
4650 pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
4651 #[serde(skip_serializing_if = "Option::is_none")]
4653 pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
4654 #[serde(skip_serializing_if = "Option::is_none")]
4656 #[serde(with = "stripe_types::with_serde_json_opt")]
4657 pub oxxo: Option<miniserde::json::Value>,
4658 #[serde(skip_serializing_if = "Option::is_none")]
4660 pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
4661 #[serde(skip_serializing_if = "Option::is_none")]
4663 #[serde(with = "stripe_types::with_serde_json_opt")]
4664 pub pay_by_bank: Option<miniserde::json::Value>,
4665 #[serde(skip_serializing_if = "Option::is_none")]
4667 #[serde(with = "stripe_types::with_serde_json_opt")]
4668 pub payco: Option<miniserde::json::Value>,
4669 #[serde(skip_serializing_if = "Option::is_none")]
4671 #[serde(with = "stripe_types::with_serde_json_opt")]
4672 pub paynow: Option<miniserde::json::Value>,
4673 #[serde(skip_serializing_if = "Option::is_none")]
4675 #[serde(with = "stripe_types::with_serde_json_opt")]
4676 pub paypal: Option<miniserde::json::Value>,
4677 #[serde(skip_serializing_if = "Option::is_none")]
4679 #[serde(with = "stripe_types::with_serde_json_opt")]
4680 pub pix: Option<miniserde::json::Value>,
4681 #[serde(skip_serializing_if = "Option::is_none")]
4683 #[serde(with = "stripe_types::with_serde_json_opt")]
4684 pub promptpay: Option<miniserde::json::Value>,
4685 #[serde(skip_serializing_if = "Option::is_none")]
4688 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
4689 #[serde(skip_serializing_if = "Option::is_none")]
4691 #[serde(with = "stripe_types::with_serde_json_opt")]
4692 pub revolut_pay: Option<miniserde::json::Value>,
4693 #[serde(skip_serializing_if = "Option::is_none")]
4695 #[serde(with = "stripe_types::with_serde_json_opt")]
4696 pub samsung_pay: Option<miniserde::json::Value>,
4697 #[serde(skip_serializing_if = "Option::is_none")]
4699 #[serde(with = "stripe_types::with_serde_json_opt")]
4700 pub satispay: Option<miniserde::json::Value>,
4701 #[serde(skip_serializing_if = "Option::is_none")]
4703 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
4704 #[serde(skip_serializing_if = "Option::is_none")]
4706 pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
4707 #[serde(skip_serializing_if = "Option::is_none")]
4709 #[serde(with = "stripe_types::with_serde_json_opt")]
4710 pub swish: Option<miniserde::json::Value>,
4711 #[serde(skip_serializing_if = "Option::is_none")]
4713 #[serde(with = "stripe_types::with_serde_json_opt")]
4714 pub twint: Option<miniserde::json::Value>,
4715 #[serde(rename = "type")]
4719 pub type_: UpdateSetupIntentPaymentMethodDataType,
4720 #[serde(skip_serializing_if = "Option::is_none")]
4722 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
4723 #[serde(skip_serializing_if = "Option::is_none")]
4725 #[serde(with = "stripe_types::with_serde_json_opt")]
4726 pub wechat_pay: Option<miniserde::json::Value>,
4727 #[serde(skip_serializing_if = "Option::is_none")]
4729 #[serde(with = "stripe_types::with_serde_json_opt")]
4730 pub zip: Option<miniserde::json::Value>,
4731}
4732impl UpdateSetupIntentPaymentMethodData {
4733 pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
4734 Self {
4735 acss_debit: None,
4736 affirm: None,
4737 afterpay_clearpay: None,
4738 alipay: None,
4739 allow_redisplay: None,
4740 alma: None,
4741 amazon_pay: None,
4742 au_becs_debit: None,
4743 bacs_debit: None,
4744 bancontact: None,
4745 billie: None,
4746 billing_details: None,
4747 blik: None,
4748 boleto: None,
4749 cashapp: None,
4750 crypto: None,
4751 customer_balance: None,
4752 eps: None,
4753 fpx: None,
4754 giropay: None,
4755 grabpay: None,
4756 ideal: None,
4757 interac_present: None,
4758 kakao_pay: None,
4759 klarna: None,
4760 konbini: None,
4761 kr_card: None,
4762 link: None,
4763 mb_way: None,
4764 metadata: None,
4765 mobilepay: None,
4766 multibanco: None,
4767 naver_pay: None,
4768 nz_bank_account: None,
4769 oxxo: None,
4770 p24: None,
4771 pay_by_bank: None,
4772 payco: None,
4773 paynow: None,
4774 paypal: None,
4775 pix: None,
4776 promptpay: None,
4777 radar_options: None,
4778 revolut_pay: None,
4779 samsung_pay: None,
4780 satispay: None,
4781 sepa_debit: None,
4782 sofort: None,
4783 swish: None,
4784 twint: None,
4785 type_: type_.into(),
4786 us_bank_account: None,
4787 wechat_pay: None,
4788 zip: None,
4789 }
4790 }
4791}
4792#[derive(Copy, Clone, Eq, PartialEq)]
4796pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4797 Always,
4798 Limited,
4799 Unspecified,
4800}
4801impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4802 pub fn as_str(self) -> &'static str {
4803 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4804 match self {
4805 Always => "always",
4806 Limited => "limited",
4807 Unspecified => "unspecified",
4808 }
4809 }
4810}
4811
4812impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4813 type Err = stripe_types::StripeParseError;
4814 fn from_str(s: &str) -> Result<Self, Self::Err> {
4815 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4816 match s {
4817 "always" => Ok(Always),
4818 "limited" => Ok(Limited),
4819 "unspecified" => Ok(Unspecified),
4820 _ => Err(stripe_types::StripeParseError),
4821 }
4822 }
4823}
4824impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4825 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4826 f.write_str(self.as_str())
4827 }
4828}
4829
4830impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4831 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4832 f.write_str(self.as_str())
4833 }
4834}
4835impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4836 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4837 where
4838 S: serde::Serializer,
4839 {
4840 serializer.serialize_str(self.as_str())
4841 }
4842}
4843#[cfg(feature = "deserialize")]
4844impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4845 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4846 use std::str::FromStr;
4847 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4848 Self::from_str(&s).map_err(|_| {
4849 serde::de::Error::custom(
4850 "Unknown value for UpdateSetupIntentPaymentMethodDataAllowRedisplay",
4851 )
4852 })
4853 }
4854}
4855#[derive(Clone, Debug, serde::Serialize)]
4857pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4858 pub account_number: String,
4860 pub bsb_number: String,
4862}
4863impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4864 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
4865 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
4866 }
4867}
4868#[derive(Clone, Debug, serde::Serialize)]
4870pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
4871 #[serde(skip_serializing_if = "Option::is_none")]
4873 pub account_number: Option<String>,
4874 #[serde(skip_serializing_if = "Option::is_none")]
4876 pub sort_code: Option<String>,
4877}
4878impl UpdateSetupIntentPaymentMethodDataBacsDebit {
4879 pub fn new() -> Self {
4880 Self { account_number: None, sort_code: None }
4881 }
4882}
4883impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
4884 fn default() -> Self {
4885 Self::new()
4886 }
4887}
4888#[derive(Clone, Debug, serde::Serialize)]
4890pub struct UpdateSetupIntentPaymentMethodDataBoleto {
4891 pub tax_id: String,
4893}
4894impl UpdateSetupIntentPaymentMethodDataBoleto {
4895 pub fn new(tax_id: impl Into<String>) -> Self {
4896 Self { tax_id: tax_id.into() }
4897 }
4898}
4899#[derive(Clone, Debug, serde::Serialize)]
4901pub struct UpdateSetupIntentPaymentMethodDataEps {
4902 #[serde(skip_serializing_if = "Option::is_none")]
4904 pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
4905}
4906impl UpdateSetupIntentPaymentMethodDataEps {
4907 pub fn new() -> Self {
4908 Self { bank: None }
4909 }
4910}
4911impl Default for UpdateSetupIntentPaymentMethodDataEps {
4912 fn default() -> Self {
4913 Self::new()
4914 }
4915}
4916#[derive(Clone, Eq, PartialEq)]
4918#[non_exhaustive]
4919pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
4920 ArzteUndApothekerBank,
4921 AustrianAnadiBankAg,
4922 BankAustria,
4923 BankhausCarlSpangler,
4924 BankhausSchelhammerUndSchatteraAg,
4925 BawagPskAg,
4926 BksBankAg,
4927 BrullKallmusBankAg,
4928 BtvVierLanderBank,
4929 CapitalBankGraweGruppeAg,
4930 DeutscheBankAg,
4931 Dolomitenbank,
4932 EasybankAg,
4933 ErsteBankUndSparkassen,
4934 HypoAlpeadriabankInternationalAg,
4935 HypoBankBurgenlandAktiengesellschaft,
4936 HypoNoeLbFurNiederosterreichUWien,
4937 HypoOberosterreichSalzburgSteiermark,
4938 HypoTirolBankAg,
4939 HypoVorarlbergBankAg,
4940 MarchfelderBank,
4941 OberbankAg,
4942 RaiffeisenBankengruppeOsterreich,
4943 SchoellerbankAg,
4944 SpardaBankWien,
4945 VolksbankGruppe,
4946 VolkskreditbankAg,
4947 VrBankBraunau,
4948 Unknown(String),
4950}
4951impl UpdateSetupIntentPaymentMethodDataEpsBank {
4952 pub fn as_str(&self) -> &str {
4953 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
4954 match self {
4955 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
4956 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
4957 BankAustria => "bank_austria",
4958 BankhausCarlSpangler => "bankhaus_carl_spangler",
4959 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
4960 BawagPskAg => "bawag_psk_ag",
4961 BksBankAg => "bks_bank_ag",
4962 BrullKallmusBankAg => "brull_kallmus_bank_ag",
4963 BtvVierLanderBank => "btv_vier_lander_bank",
4964 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
4965 DeutscheBankAg => "deutsche_bank_ag",
4966 Dolomitenbank => "dolomitenbank",
4967 EasybankAg => "easybank_ag",
4968 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
4969 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
4970 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
4971 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
4972 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
4973 HypoTirolBankAg => "hypo_tirol_bank_ag",
4974 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
4975 MarchfelderBank => "marchfelder_bank",
4976 OberbankAg => "oberbank_ag",
4977 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
4978 SchoellerbankAg => "schoellerbank_ag",
4979 SpardaBankWien => "sparda_bank_wien",
4980 VolksbankGruppe => "volksbank_gruppe",
4981 VolkskreditbankAg => "volkskreditbank_ag",
4982 VrBankBraunau => "vr_bank_braunau",
4983 Unknown(v) => v,
4984 }
4985 }
4986}
4987
4988impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
4989 type Err = std::convert::Infallible;
4990 fn from_str(s: &str) -> Result<Self, Self::Err> {
4991 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
4992 match s {
4993 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
4994 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
4995 "bank_austria" => Ok(BankAustria),
4996 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
4997 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
4998 "bawag_psk_ag" => Ok(BawagPskAg),
4999 "bks_bank_ag" => Ok(BksBankAg),
5000 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
5001 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
5002 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
5003 "deutsche_bank_ag" => Ok(DeutscheBankAg),
5004 "dolomitenbank" => Ok(Dolomitenbank),
5005 "easybank_ag" => Ok(EasybankAg),
5006 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
5007 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
5008 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
5009 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
5010 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
5011 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
5012 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
5013 "marchfelder_bank" => Ok(MarchfelderBank),
5014 "oberbank_ag" => Ok(OberbankAg),
5015 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
5016 "schoellerbank_ag" => Ok(SchoellerbankAg),
5017 "sparda_bank_wien" => Ok(SpardaBankWien),
5018 "volksbank_gruppe" => Ok(VolksbankGruppe),
5019 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
5020 "vr_bank_braunau" => Ok(VrBankBraunau),
5021 v => Ok(Unknown(v.to_owned())),
5022 }
5023 }
5024}
5025impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
5026 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5027 f.write_str(self.as_str())
5028 }
5029}
5030
5031impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
5032 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5033 f.write_str(self.as_str())
5034 }
5035}
5036impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
5037 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5038 where
5039 S: serde::Serializer,
5040 {
5041 serializer.serialize_str(self.as_str())
5042 }
5043}
5044#[cfg(feature = "deserialize")]
5045impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
5046 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5047 use std::str::FromStr;
5048 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5049 Ok(Self::from_str(&s).unwrap())
5050 }
5051}
5052#[derive(Clone, Debug, serde::Serialize)]
5054pub struct UpdateSetupIntentPaymentMethodDataFpx {
5055 #[serde(skip_serializing_if = "Option::is_none")]
5057 pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
5058 pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
5060}
5061impl UpdateSetupIntentPaymentMethodDataFpx {
5062 pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
5063 Self { account_holder_type: None, bank: bank.into() }
5064 }
5065}
5066#[derive(Copy, Clone, Eq, PartialEq)]
5068pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5069 Company,
5070 Individual,
5071}
5072impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5073 pub fn as_str(self) -> &'static str {
5074 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5075 match self {
5076 Company => "company",
5077 Individual => "individual",
5078 }
5079 }
5080}
5081
5082impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5083 type Err = stripe_types::StripeParseError;
5084 fn from_str(s: &str) -> Result<Self, Self::Err> {
5085 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5086 match s {
5087 "company" => Ok(Company),
5088 "individual" => Ok(Individual),
5089 _ => Err(stripe_types::StripeParseError),
5090 }
5091 }
5092}
5093impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5094 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5095 f.write_str(self.as_str())
5096 }
5097}
5098
5099impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5100 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5101 f.write_str(self.as_str())
5102 }
5103}
5104impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5105 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5106 where
5107 S: serde::Serializer,
5108 {
5109 serializer.serialize_str(self.as_str())
5110 }
5111}
5112#[cfg(feature = "deserialize")]
5113impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5114 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5115 use std::str::FromStr;
5116 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5117 Self::from_str(&s).map_err(|_| {
5118 serde::de::Error::custom(
5119 "Unknown value for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType",
5120 )
5121 })
5122 }
5123}
5124#[derive(Clone, Eq, PartialEq)]
5126#[non_exhaustive]
5127pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
5128 AffinBank,
5129 Agrobank,
5130 AllianceBank,
5131 Ambank,
5132 BankIslam,
5133 BankMuamalat,
5134 BankOfChina,
5135 BankRakyat,
5136 Bsn,
5137 Cimb,
5138 DeutscheBank,
5139 HongLeongBank,
5140 Hsbc,
5141 Kfh,
5142 Maybank2e,
5143 Maybank2u,
5144 Ocbc,
5145 PbEnterprise,
5146 PublicBank,
5147 Rhb,
5148 StandardChartered,
5149 Uob,
5150 Unknown(String),
5152}
5153impl UpdateSetupIntentPaymentMethodDataFpxBank {
5154 pub fn as_str(&self) -> &str {
5155 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5156 match self {
5157 AffinBank => "affin_bank",
5158 Agrobank => "agrobank",
5159 AllianceBank => "alliance_bank",
5160 Ambank => "ambank",
5161 BankIslam => "bank_islam",
5162 BankMuamalat => "bank_muamalat",
5163 BankOfChina => "bank_of_china",
5164 BankRakyat => "bank_rakyat",
5165 Bsn => "bsn",
5166 Cimb => "cimb",
5167 DeutscheBank => "deutsche_bank",
5168 HongLeongBank => "hong_leong_bank",
5169 Hsbc => "hsbc",
5170 Kfh => "kfh",
5171 Maybank2e => "maybank2e",
5172 Maybank2u => "maybank2u",
5173 Ocbc => "ocbc",
5174 PbEnterprise => "pb_enterprise",
5175 PublicBank => "public_bank",
5176 Rhb => "rhb",
5177 StandardChartered => "standard_chartered",
5178 Uob => "uob",
5179 Unknown(v) => v,
5180 }
5181 }
5182}
5183
5184impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
5185 type Err = std::convert::Infallible;
5186 fn from_str(s: &str) -> Result<Self, Self::Err> {
5187 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5188 match s {
5189 "affin_bank" => Ok(AffinBank),
5190 "agrobank" => Ok(Agrobank),
5191 "alliance_bank" => Ok(AllianceBank),
5192 "ambank" => Ok(Ambank),
5193 "bank_islam" => Ok(BankIslam),
5194 "bank_muamalat" => Ok(BankMuamalat),
5195 "bank_of_china" => Ok(BankOfChina),
5196 "bank_rakyat" => Ok(BankRakyat),
5197 "bsn" => Ok(Bsn),
5198 "cimb" => Ok(Cimb),
5199 "deutsche_bank" => Ok(DeutscheBank),
5200 "hong_leong_bank" => Ok(HongLeongBank),
5201 "hsbc" => Ok(Hsbc),
5202 "kfh" => Ok(Kfh),
5203 "maybank2e" => Ok(Maybank2e),
5204 "maybank2u" => Ok(Maybank2u),
5205 "ocbc" => Ok(Ocbc),
5206 "pb_enterprise" => Ok(PbEnterprise),
5207 "public_bank" => Ok(PublicBank),
5208 "rhb" => Ok(Rhb),
5209 "standard_chartered" => Ok(StandardChartered),
5210 "uob" => Ok(Uob),
5211 v => Ok(Unknown(v.to_owned())),
5212 }
5213 }
5214}
5215impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
5216 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5217 f.write_str(self.as_str())
5218 }
5219}
5220
5221impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
5222 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5223 f.write_str(self.as_str())
5224 }
5225}
5226impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
5227 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5228 where
5229 S: serde::Serializer,
5230 {
5231 serializer.serialize_str(self.as_str())
5232 }
5233}
5234#[cfg(feature = "deserialize")]
5235impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
5236 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5237 use std::str::FromStr;
5238 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5239 Ok(Self::from_str(&s).unwrap())
5240 }
5241}
5242#[derive(Clone, Debug, serde::Serialize)]
5244pub struct UpdateSetupIntentPaymentMethodDataIdeal {
5245 #[serde(skip_serializing_if = "Option::is_none")]
5249 pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
5250}
5251impl UpdateSetupIntentPaymentMethodDataIdeal {
5252 pub fn new() -> Self {
5253 Self { bank: None }
5254 }
5255}
5256impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
5257 fn default() -> Self {
5258 Self::new()
5259 }
5260}
5261#[derive(Clone, Eq, PartialEq)]
5265#[non_exhaustive]
5266pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
5267 AbnAmro,
5268 AsnBank,
5269 Bunq,
5270 Buut,
5271 Handelsbanken,
5272 Ing,
5273 Knab,
5274 Moneyou,
5275 N26,
5276 Nn,
5277 Rabobank,
5278 Regiobank,
5279 Revolut,
5280 SnsBank,
5281 TriodosBank,
5282 VanLanschot,
5283 Yoursafe,
5284 Unknown(String),
5286}
5287impl UpdateSetupIntentPaymentMethodDataIdealBank {
5288 pub fn as_str(&self) -> &str {
5289 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5290 match self {
5291 AbnAmro => "abn_amro",
5292 AsnBank => "asn_bank",
5293 Bunq => "bunq",
5294 Buut => "buut",
5295 Handelsbanken => "handelsbanken",
5296 Ing => "ing",
5297 Knab => "knab",
5298 Moneyou => "moneyou",
5299 N26 => "n26",
5300 Nn => "nn",
5301 Rabobank => "rabobank",
5302 Regiobank => "regiobank",
5303 Revolut => "revolut",
5304 SnsBank => "sns_bank",
5305 TriodosBank => "triodos_bank",
5306 VanLanschot => "van_lanschot",
5307 Yoursafe => "yoursafe",
5308 Unknown(v) => v,
5309 }
5310 }
5311}
5312
5313impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
5314 type Err = std::convert::Infallible;
5315 fn from_str(s: &str) -> Result<Self, Self::Err> {
5316 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5317 match s {
5318 "abn_amro" => Ok(AbnAmro),
5319 "asn_bank" => Ok(AsnBank),
5320 "bunq" => Ok(Bunq),
5321 "buut" => Ok(Buut),
5322 "handelsbanken" => Ok(Handelsbanken),
5323 "ing" => Ok(Ing),
5324 "knab" => Ok(Knab),
5325 "moneyou" => Ok(Moneyou),
5326 "n26" => Ok(N26),
5327 "nn" => Ok(Nn),
5328 "rabobank" => Ok(Rabobank),
5329 "regiobank" => Ok(Regiobank),
5330 "revolut" => Ok(Revolut),
5331 "sns_bank" => Ok(SnsBank),
5332 "triodos_bank" => Ok(TriodosBank),
5333 "van_lanschot" => Ok(VanLanschot),
5334 "yoursafe" => Ok(Yoursafe),
5335 v => Ok(Unknown(v.to_owned())),
5336 }
5337 }
5338}
5339impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
5340 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5341 f.write_str(self.as_str())
5342 }
5343}
5344
5345impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
5346 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5347 f.write_str(self.as_str())
5348 }
5349}
5350impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
5351 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5352 where
5353 S: serde::Serializer,
5354 {
5355 serializer.serialize_str(self.as_str())
5356 }
5357}
5358#[cfg(feature = "deserialize")]
5359impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
5360 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5361 use std::str::FromStr;
5362 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5363 Ok(Self::from_str(&s).unwrap())
5364 }
5365}
5366#[derive(Copy, Clone, Debug, serde::Serialize)]
5368pub struct UpdateSetupIntentPaymentMethodDataKlarna {
5369 #[serde(skip_serializing_if = "Option::is_none")]
5371 pub dob: Option<DateOfBirth>,
5372}
5373impl UpdateSetupIntentPaymentMethodDataKlarna {
5374 pub fn new() -> Self {
5375 Self { dob: None }
5376 }
5377}
5378impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
5379 fn default() -> Self {
5380 Self::new()
5381 }
5382}
5383#[derive(Copy, Clone, Debug, serde::Serialize)]
5385pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
5386 #[serde(skip_serializing_if = "Option::is_none")]
5389 pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
5390}
5391impl UpdateSetupIntentPaymentMethodDataNaverPay {
5392 pub fn new() -> Self {
5393 Self { funding: None }
5394 }
5395}
5396impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
5397 fn default() -> Self {
5398 Self::new()
5399 }
5400}
5401#[derive(Copy, Clone, Eq, PartialEq)]
5404pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5405 Card,
5406 Points,
5407}
5408impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5409 pub fn as_str(self) -> &'static str {
5410 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5411 match self {
5412 Card => "card",
5413 Points => "points",
5414 }
5415 }
5416}
5417
5418impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5419 type Err = stripe_types::StripeParseError;
5420 fn from_str(s: &str) -> Result<Self, Self::Err> {
5421 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5422 match s {
5423 "card" => Ok(Card),
5424 "points" => Ok(Points),
5425 _ => Err(stripe_types::StripeParseError),
5426 }
5427 }
5428}
5429impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5430 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5431 f.write_str(self.as_str())
5432 }
5433}
5434
5435impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5436 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5437 f.write_str(self.as_str())
5438 }
5439}
5440impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5441 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5442 where
5443 S: serde::Serializer,
5444 {
5445 serializer.serialize_str(self.as_str())
5446 }
5447}
5448#[cfg(feature = "deserialize")]
5449impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5450 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5451 use std::str::FromStr;
5452 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5453 Self::from_str(&s).map_err(|_| {
5454 serde::de::Error::custom(
5455 "Unknown value for UpdateSetupIntentPaymentMethodDataNaverPayFunding",
5456 )
5457 })
5458 }
5459}
5460#[derive(Clone, Debug, serde::Serialize)]
5462pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
5463 #[serde(skip_serializing_if = "Option::is_none")]
5466 pub account_holder_name: Option<String>,
5467 pub account_number: String,
5469 pub bank_code: String,
5471 pub branch_code: String,
5473 #[serde(skip_serializing_if = "Option::is_none")]
5474 pub reference: Option<String>,
5475 pub suffix: String,
5477}
5478impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
5479 pub fn new(
5480 account_number: impl Into<String>,
5481 bank_code: impl Into<String>,
5482 branch_code: impl Into<String>,
5483 suffix: impl Into<String>,
5484 ) -> Self {
5485 Self {
5486 account_holder_name: None,
5487 account_number: account_number.into(),
5488 bank_code: bank_code.into(),
5489 branch_code: branch_code.into(),
5490 reference: None,
5491 suffix: suffix.into(),
5492 }
5493 }
5494}
5495#[derive(Clone, Debug, serde::Serialize)]
5497pub struct UpdateSetupIntentPaymentMethodDataP24 {
5498 #[serde(skip_serializing_if = "Option::is_none")]
5500 pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
5501}
5502impl UpdateSetupIntentPaymentMethodDataP24 {
5503 pub fn new() -> Self {
5504 Self { bank: None }
5505 }
5506}
5507impl Default for UpdateSetupIntentPaymentMethodDataP24 {
5508 fn default() -> Self {
5509 Self::new()
5510 }
5511}
5512#[derive(Clone, Eq, PartialEq)]
5514#[non_exhaustive]
5515pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
5516 AliorBank,
5517 BankMillennium,
5518 BankNowyBfgSa,
5519 BankPekaoSa,
5520 BankiSpbdzielcze,
5521 Blik,
5522 BnpParibas,
5523 Boz,
5524 CitiHandlowy,
5525 CreditAgricole,
5526 Envelobank,
5527 EtransferPocztowy24,
5528 GetinBank,
5529 Ideabank,
5530 Ing,
5531 Inteligo,
5532 MbankMtransfer,
5533 NestPrzelew,
5534 NoblePay,
5535 PbacZIpko,
5536 PlusBank,
5537 SantanderPrzelew24,
5538 TmobileUsbugiBankowe,
5539 ToyotaBank,
5540 Velobank,
5541 VolkswagenBank,
5542 Unknown(String),
5544}
5545impl UpdateSetupIntentPaymentMethodDataP24Bank {
5546 pub fn as_str(&self) -> &str {
5547 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5548 match self {
5549 AliorBank => "alior_bank",
5550 BankMillennium => "bank_millennium",
5551 BankNowyBfgSa => "bank_nowy_bfg_sa",
5552 BankPekaoSa => "bank_pekao_sa",
5553 BankiSpbdzielcze => "banki_spbdzielcze",
5554 Blik => "blik",
5555 BnpParibas => "bnp_paribas",
5556 Boz => "boz",
5557 CitiHandlowy => "citi_handlowy",
5558 CreditAgricole => "credit_agricole",
5559 Envelobank => "envelobank",
5560 EtransferPocztowy24 => "etransfer_pocztowy24",
5561 GetinBank => "getin_bank",
5562 Ideabank => "ideabank",
5563 Ing => "ing",
5564 Inteligo => "inteligo",
5565 MbankMtransfer => "mbank_mtransfer",
5566 NestPrzelew => "nest_przelew",
5567 NoblePay => "noble_pay",
5568 PbacZIpko => "pbac_z_ipko",
5569 PlusBank => "plus_bank",
5570 SantanderPrzelew24 => "santander_przelew24",
5571 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
5572 ToyotaBank => "toyota_bank",
5573 Velobank => "velobank",
5574 VolkswagenBank => "volkswagen_bank",
5575 Unknown(v) => v,
5576 }
5577 }
5578}
5579
5580impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
5581 type Err = std::convert::Infallible;
5582 fn from_str(s: &str) -> Result<Self, Self::Err> {
5583 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5584 match s {
5585 "alior_bank" => Ok(AliorBank),
5586 "bank_millennium" => Ok(BankMillennium),
5587 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
5588 "bank_pekao_sa" => Ok(BankPekaoSa),
5589 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
5590 "blik" => Ok(Blik),
5591 "bnp_paribas" => Ok(BnpParibas),
5592 "boz" => Ok(Boz),
5593 "citi_handlowy" => Ok(CitiHandlowy),
5594 "credit_agricole" => Ok(CreditAgricole),
5595 "envelobank" => Ok(Envelobank),
5596 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
5597 "getin_bank" => Ok(GetinBank),
5598 "ideabank" => Ok(Ideabank),
5599 "ing" => Ok(Ing),
5600 "inteligo" => Ok(Inteligo),
5601 "mbank_mtransfer" => Ok(MbankMtransfer),
5602 "nest_przelew" => Ok(NestPrzelew),
5603 "noble_pay" => Ok(NoblePay),
5604 "pbac_z_ipko" => Ok(PbacZIpko),
5605 "plus_bank" => Ok(PlusBank),
5606 "santander_przelew24" => Ok(SantanderPrzelew24),
5607 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
5608 "toyota_bank" => Ok(ToyotaBank),
5609 "velobank" => Ok(Velobank),
5610 "volkswagen_bank" => Ok(VolkswagenBank),
5611 v => Ok(Unknown(v.to_owned())),
5612 }
5613 }
5614}
5615impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
5616 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5617 f.write_str(self.as_str())
5618 }
5619}
5620
5621impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
5622 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5623 f.write_str(self.as_str())
5624 }
5625}
5626impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
5627 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5628 where
5629 S: serde::Serializer,
5630 {
5631 serializer.serialize_str(self.as_str())
5632 }
5633}
5634#[cfg(feature = "deserialize")]
5635impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
5636 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5637 use std::str::FromStr;
5638 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5639 Ok(Self::from_str(&s).unwrap())
5640 }
5641}
5642#[derive(Clone, Debug, serde::Serialize)]
5644pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
5645 pub iban: String,
5647}
5648impl UpdateSetupIntentPaymentMethodDataSepaDebit {
5649 pub fn new(iban: impl Into<String>) -> Self {
5650 Self { iban: iban.into() }
5651 }
5652}
5653#[derive(Copy, Clone, Debug, serde::Serialize)]
5655pub struct UpdateSetupIntentPaymentMethodDataSofort {
5656 pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
5658}
5659impl UpdateSetupIntentPaymentMethodDataSofort {
5660 pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
5661 Self { country: country.into() }
5662 }
5663}
5664#[derive(Copy, Clone, Eq, PartialEq)]
5666pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
5667 At,
5668 Be,
5669 De,
5670 Es,
5671 It,
5672 Nl,
5673}
5674impl UpdateSetupIntentPaymentMethodDataSofortCountry {
5675 pub fn as_str(self) -> &'static str {
5676 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5677 match self {
5678 At => "AT",
5679 Be => "BE",
5680 De => "DE",
5681 Es => "ES",
5682 It => "IT",
5683 Nl => "NL",
5684 }
5685 }
5686}
5687
5688impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
5689 type Err = stripe_types::StripeParseError;
5690 fn from_str(s: &str) -> Result<Self, Self::Err> {
5691 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5692 match s {
5693 "AT" => Ok(At),
5694 "BE" => Ok(Be),
5695 "DE" => Ok(De),
5696 "ES" => Ok(Es),
5697 "IT" => Ok(It),
5698 "NL" => Ok(Nl),
5699 _ => Err(stripe_types::StripeParseError),
5700 }
5701 }
5702}
5703impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
5704 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5705 f.write_str(self.as_str())
5706 }
5707}
5708
5709impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
5710 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5711 f.write_str(self.as_str())
5712 }
5713}
5714impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
5715 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5716 where
5717 S: serde::Serializer,
5718 {
5719 serializer.serialize_str(self.as_str())
5720 }
5721}
5722#[cfg(feature = "deserialize")]
5723impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
5724 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5725 use std::str::FromStr;
5726 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5727 Self::from_str(&s).map_err(|_| {
5728 serde::de::Error::custom(
5729 "Unknown value for UpdateSetupIntentPaymentMethodDataSofortCountry",
5730 )
5731 })
5732 }
5733}
5734#[derive(Clone, Eq, PartialEq)]
5738#[non_exhaustive]
5739pub enum UpdateSetupIntentPaymentMethodDataType {
5740 AcssDebit,
5741 Affirm,
5742 AfterpayClearpay,
5743 Alipay,
5744 Alma,
5745 AmazonPay,
5746 AuBecsDebit,
5747 BacsDebit,
5748 Bancontact,
5749 Billie,
5750 Blik,
5751 Boleto,
5752 Cashapp,
5753 Crypto,
5754 CustomerBalance,
5755 Eps,
5756 Fpx,
5757 Giropay,
5758 Grabpay,
5759 Ideal,
5760 KakaoPay,
5761 Klarna,
5762 Konbini,
5763 KrCard,
5764 Link,
5765 MbWay,
5766 Mobilepay,
5767 Multibanco,
5768 NaverPay,
5769 NzBankAccount,
5770 Oxxo,
5771 P24,
5772 PayByBank,
5773 Payco,
5774 Paynow,
5775 Paypal,
5776 Pix,
5777 Promptpay,
5778 RevolutPay,
5779 SamsungPay,
5780 Satispay,
5781 SepaDebit,
5782 Sofort,
5783 Swish,
5784 Twint,
5785 UsBankAccount,
5786 WechatPay,
5787 Zip,
5788 Unknown(String),
5790}
5791impl UpdateSetupIntentPaymentMethodDataType {
5792 pub fn as_str(&self) -> &str {
5793 use UpdateSetupIntentPaymentMethodDataType::*;
5794 match self {
5795 AcssDebit => "acss_debit",
5796 Affirm => "affirm",
5797 AfterpayClearpay => "afterpay_clearpay",
5798 Alipay => "alipay",
5799 Alma => "alma",
5800 AmazonPay => "amazon_pay",
5801 AuBecsDebit => "au_becs_debit",
5802 BacsDebit => "bacs_debit",
5803 Bancontact => "bancontact",
5804 Billie => "billie",
5805 Blik => "blik",
5806 Boleto => "boleto",
5807 Cashapp => "cashapp",
5808 Crypto => "crypto",
5809 CustomerBalance => "customer_balance",
5810 Eps => "eps",
5811 Fpx => "fpx",
5812 Giropay => "giropay",
5813 Grabpay => "grabpay",
5814 Ideal => "ideal",
5815 KakaoPay => "kakao_pay",
5816 Klarna => "klarna",
5817 Konbini => "konbini",
5818 KrCard => "kr_card",
5819 Link => "link",
5820 MbWay => "mb_way",
5821 Mobilepay => "mobilepay",
5822 Multibanco => "multibanco",
5823 NaverPay => "naver_pay",
5824 NzBankAccount => "nz_bank_account",
5825 Oxxo => "oxxo",
5826 P24 => "p24",
5827 PayByBank => "pay_by_bank",
5828 Payco => "payco",
5829 Paynow => "paynow",
5830 Paypal => "paypal",
5831 Pix => "pix",
5832 Promptpay => "promptpay",
5833 RevolutPay => "revolut_pay",
5834 SamsungPay => "samsung_pay",
5835 Satispay => "satispay",
5836 SepaDebit => "sepa_debit",
5837 Sofort => "sofort",
5838 Swish => "swish",
5839 Twint => "twint",
5840 UsBankAccount => "us_bank_account",
5841 WechatPay => "wechat_pay",
5842 Zip => "zip",
5843 Unknown(v) => v,
5844 }
5845 }
5846}
5847
5848impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
5849 type Err = std::convert::Infallible;
5850 fn from_str(s: &str) -> Result<Self, Self::Err> {
5851 use UpdateSetupIntentPaymentMethodDataType::*;
5852 match s {
5853 "acss_debit" => Ok(AcssDebit),
5854 "affirm" => Ok(Affirm),
5855 "afterpay_clearpay" => Ok(AfterpayClearpay),
5856 "alipay" => Ok(Alipay),
5857 "alma" => Ok(Alma),
5858 "amazon_pay" => Ok(AmazonPay),
5859 "au_becs_debit" => Ok(AuBecsDebit),
5860 "bacs_debit" => Ok(BacsDebit),
5861 "bancontact" => Ok(Bancontact),
5862 "billie" => Ok(Billie),
5863 "blik" => Ok(Blik),
5864 "boleto" => Ok(Boleto),
5865 "cashapp" => Ok(Cashapp),
5866 "crypto" => Ok(Crypto),
5867 "customer_balance" => Ok(CustomerBalance),
5868 "eps" => Ok(Eps),
5869 "fpx" => Ok(Fpx),
5870 "giropay" => Ok(Giropay),
5871 "grabpay" => Ok(Grabpay),
5872 "ideal" => Ok(Ideal),
5873 "kakao_pay" => Ok(KakaoPay),
5874 "klarna" => Ok(Klarna),
5875 "konbini" => Ok(Konbini),
5876 "kr_card" => Ok(KrCard),
5877 "link" => Ok(Link),
5878 "mb_way" => Ok(MbWay),
5879 "mobilepay" => Ok(Mobilepay),
5880 "multibanco" => Ok(Multibanco),
5881 "naver_pay" => Ok(NaverPay),
5882 "nz_bank_account" => Ok(NzBankAccount),
5883 "oxxo" => Ok(Oxxo),
5884 "p24" => Ok(P24),
5885 "pay_by_bank" => Ok(PayByBank),
5886 "payco" => Ok(Payco),
5887 "paynow" => Ok(Paynow),
5888 "paypal" => Ok(Paypal),
5889 "pix" => Ok(Pix),
5890 "promptpay" => Ok(Promptpay),
5891 "revolut_pay" => Ok(RevolutPay),
5892 "samsung_pay" => Ok(SamsungPay),
5893 "satispay" => Ok(Satispay),
5894 "sepa_debit" => Ok(SepaDebit),
5895 "sofort" => Ok(Sofort),
5896 "swish" => Ok(Swish),
5897 "twint" => Ok(Twint),
5898 "us_bank_account" => Ok(UsBankAccount),
5899 "wechat_pay" => Ok(WechatPay),
5900 "zip" => Ok(Zip),
5901 v => Ok(Unknown(v.to_owned())),
5902 }
5903 }
5904}
5905impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
5906 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5907 f.write_str(self.as_str())
5908 }
5909}
5910
5911impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
5912 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5913 f.write_str(self.as_str())
5914 }
5915}
5916impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
5917 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5918 where
5919 S: serde::Serializer,
5920 {
5921 serializer.serialize_str(self.as_str())
5922 }
5923}
5924#[cfg(feature = "deserialize")]
5925impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
5926 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5927 use std::str::FromStr;
5928 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5929 Ok(Self::from_str(&s).unwrap())
5930 }
5931}
5932#[derive(Clone, Debug, serde::Serialize)]
5934pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
5935 #[serde(skip_serializing_if = "Option::is_none")]
5937 pub account_holder_type:
5938 Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
5939 #[serde(skip_serializing_if = "Option::is_none")]
5941 pub account_number: Option<String>,
5942 #[serde(skip_serializing_if = "Option::is_none")]
5944 pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
5945 #[serde(skip_serializing_if = "Option::is_none")]
5947 pub financial_connections_account: Option<String>,
5948 #[serde(skip_serializing_if = "Option::is_none")]
5950 pub routing_number: Option<String>,
5951}
5952impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
5953 pub fn new() -> Self {
5954 Self {
5955 account_holder_type: None,
5956 account_number: None,
5957 account_type: None,
5958 financial_connections_account: None,
5959 routing_number: None,
5960 }
5961 }
5962}
5963impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
5964 fn default() -> Self {
5965 Self::new()
5966 }
5967}
5968#[derive(Copy, Clone, Eq, PartialEq)]
5970pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5971 Company,
5972 Individual,
5973}
5974impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5975 pub fn as_str(self) -> &'static str {
5976 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
5977 match self {
5978 Company => "company",
5979 Individual => "individual",
5980 }
5981 }
5982}
5983
5984impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5985 type Err = stripe_types::StripeParseError;
5986 fn from_str(s: &str) -> Result<Self, Self::Err> {
5987 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
5988 match s {
5989 "company" => Ok(Company),
5990 "individual" => Ok(Individual),
5991 _ => Err(stripe_types::StripeParseError),
5992 }
5993 }
5994}
5995impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5996 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5997 f.write_str(self.as_str())
5998 }
5999}
6000
6001impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6002 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6003 f.write_str(self.as_str())
6004 }
6005}
6006impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6007 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6008 where
6009 S: serde::Serializer,
6010 {
6011 serializer.serialize_str(self.as_str())
6012 }
6013}
6014#[cfg(feature = "deserialize")]
6015impl<'de> serde::Deserialize<'de>
6016 for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
6017{
6018 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6019 use std::str::FromStr;
6020 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6021 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
6022 }
6023}
6024#[derive(Copy, Clone, Eq, PartialEq)]
6026pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6027 Checking,
6028 Savings,
6029}
6030impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6031 pub fn as_str(self) -> &'static str {
6032 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6033 match self {
6034 Checking => "checking",
6035 Savings => "savings",
6036 }
6037 }
6038}
6039
6040impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6041 type Err = stripe_types::StripeParseError;
6042 fn from_str(s: &str) -> Result<Self, Self::Err> {
6043 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6044 match s {
6045 "checking" => Ok(Checking),
6046 "savings" => Ok(Savings),
6047 _ => Err(stripe_types::StripeParseError),
6048 }
6049 }
6050}
6051impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6052 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6053 f.write_str(self.as_str())
6054 }
6055}
6056
6057impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6058 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6059 f.write_str(self.as_str())
6060 }
6061}
6062impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6063 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6064 where
6065 S: serde::Serializer,
6066 {
6067 serializer.serialize_str(self.as_str())
6068 }
6069}
6070#[cfg(feature = "deserialize")]
6071impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6072 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6073 use std::str::FromStr;
6074 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6075 Self::from_str(&s).map_err(|_| {
6076 serde::de::Error::custom(
6077 "Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType",
6078 )
6079 })
6080 }
6081}
6082#[derive(Clone, Debug, serde::Serialize)]
6084pub struct UpdateSetupIntentPaymentMethodOptions {
6085 #[serde(skip_serializing_if = "Option::is_none")]
6087 pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
6088 #[serde(skip_serializing_if = "Option::is_none")]
6090 #[serde(with = "stripe_types::with_serde_json_opt")]
6091 pub amazon_pay: Option<miniserde::json::Value>,
6092 #[serde(skip_serializing_if = "Option::is_none")]
6094 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
6095 #[serde(skip_serializing_if = "Option::is_none")]
6097 pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
6098 #[serde(skip_serializing_if = "Option::is_none")]
6100 #[serde(with = "stripe_types::with_serde_json_opt")]
6101 pub card_present: Option<miniserde::json::Value>,
6102 #[serde(skip_serializing_if = "Option::is_none")]
6104 pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
6105 #[serde(skip_serializing_if = "Option::is_none")]
6107 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
6108 #[serde(skip_serializing_if = "Option::is_none")]
6110 pub paypal: Option<PaymentMethodOptionsParam>,
6111 #[serde(skip_serializing_if = "Option::is_none")]
6113 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
6114 #[serde(skip_serializing_if = "Option::is_none")]
6116 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
6117}
6118impl UpdateSetupIntentPaymentMethodOptions {
6119 pub fn new() -> Self {
6120 Self {
6121 acss_debit: None,
6122 amazon_pay: None,
6123 bacs_debit: None,
6124 card: None,
6125 card_present: None,
6126 klarna: None,
6127 link: None,
6128 paypal: None,
6129 sepa_debit: None,
6130 us_bank_account: None,
6131 }
6132 }
6133}
6134impl Default for UpdateSetupIntentPaymentMethodOptions {
6135 fn default() -> Self {
6136 Self::new()
6137 }
6138}
6139#[derive(Clone, Debug, serde::Serialize)]
6141pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6142 #[serde(skip_serializing_if = "Option::is_none")]
6145 pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
6146 #[serde(skip_serializing_if = "Option::is_none")]
6148 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
6149 #[serde(skip_serializing_if = "Option::is_none")]
6151 pub verification_method:
6152 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
6153}
6154impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6155 pub fn new() -> Self {
6156 Self { currency: None, mandate_options: None, verification_method: None }
6157 }
6158}
6159impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6160 fn default() -> Self {
6161 Self::new()
6162 }
6163}
6164#[derive(Copy, Clone, Eq, PartialEq)]
6167pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6168 Cad,
6169 Usd,
6170}
6171impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6172 pub fn as_str(self) -> &'static str {
6173 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6174 match self {
6175 Cad => "cad",
6176 Usd => "usd",
6177 }
6178 }
6179}
6180
6181impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6182 type Err = stripe_types::StripeParseError;
6183 fn from_str(s: &str) -> Result<Self, Self::Err> {
6184 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6185 match s {
6186 "cad" => Ok(Cad),
6187 "usd" => Ok(Usd),
6188 _ => Err(stripe_types::StripeParseError),
6189 }
6190 }
6191}
6192impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6193 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6194 f.write_str(self.as_str())
6195 }
6196}
6197
6198impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6199 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6200 f.write_str(self.as_str())
6201 }
6202}
6203impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6204 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6205 where
6206 S: serde::Serializer,
6207 {
6208 serializer.serialize_str(self.as_str())
6209 }
6210}
6211#[cfg(feature = "deserialize")]
6212impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6213 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6214 use std::str::FromStr;
6215 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6216 Self::from_str(&s).map_err(|_| {
6217 serde::de::Error::custom(
6218 "Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
6219 )
6220 })
6221 }
6222}
6223#[derive(Clone, Debug, serde::Serialize)]
6225pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6226 #[serde(skip_serializing_if = "Option::is_none")]
6230 pub custom_mandate_url: Option<String>,
6231 #[serde(skip_serializing_if = "Option::is_none")]
6233 pub default_for:
6234 Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
6235 #[serde(skip_serializing_if = "Option::is_none")]
6238 pub interval_description: Option<String>,
6239 #[serde(skip_serializing_if = "Option::is_none")]
6241 pub payment_schedule:
6242 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
6243 #[serde(skip_serializing_if = "Option::is_none")]
6245 pub transaction_type:
6246 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
6247}
6248impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6249 pub fn new() -> Self {
6250 Self {
6251 custom_mandate_url: None,
6252 default_for: None,
6253 interval_description: None,
6254 payment_schedule: None,
6255 transaction_type: None,
6256 }
6257 }
6258}
6259impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6260 fn default() -> Self {
6261 Self::new()
6262 }
6263}
6264#[derive(Copy, Clone, Eq, PartialEq)]
6266pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6267 Invoice,
6268 Subscription,
6269}
6270impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6271 pub fn as_str(self) -> &'static str {
6272 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6273 match self {
6274 Invoice => "invoice",
6275 Subscription => "subscription",
6276 }
6277 }
6278}
6279
6280impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6281 type Err = stripe_types::StripeParseError;
6282 fn from_str(s: &str) -> Result<Self, Self::Err> {
6283 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6284 match s {
6285 "invoice" => Ok(Invoice),
6286 "subscription" => Ok(Subscription),
6287 _ => Err(stripe_types::StripeParseError),
6288 }
6289 }
6290}
6291impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6292 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6293 f.write_str(self.as_str())
6294 }
6295}
6296
6297impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6298 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6299 f.write_str(self.as_str())
6300 }
6301}
6302impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6303 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6304 where
6305 S: serde::Serializer,
6306 {
6307 serializer.serialize_str(self.as_str())
6308 }
6309}
6310#[cfg(feature = "deserialize")]
6311impl<'de> serde::Deserialize<'de>
6312 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
6313{
6314 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6315 use std::str::FromStr;
6316 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6317 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
6318 }
6319}
6320#[derive(Copy, Clone, Eq, PartialEq)]
6322pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6323 Combined,
6324 Interval,
6325 Sporadic,
6326}
6327impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6328 pub fn as_str(self) -> &'static str {
6329 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6330 match self {
6331 Combined => "combined",
6332 Interval => "interval",
6333 Sporadic => "sporadic",
6334 }
6335 }
6336}
6337
6338impl std::str::FromStr
6339 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6340{
6341 type Err = stripe_types::StripeParseError;
6342 fn from_str(s: &str) -> Result<Self, Self::Err> {
6343 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6344 match s {
6345 "combined" => Ok(Combined),
6346 "interval" => Ok(Interval),
6347 "sporadic" => Ok(Sporadic),
6348 _ => Err(stripe_types::StripeParseError),
6349 }
6350 }
6351}
6352impl std::fmt::Display
6353 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6354{
6355 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6356 f.write_str(self.as_str())
6357 }
6358}
6359
6360impl std::fmt::Debug
6361 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6362{
6363 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6364 f.write_str(self.as_str())
6365 }
6366}
6367impl serde::Serialize
6368 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6369{
6370 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6371 where
6372 S: serde::Serializer,
6373 {
6374 serializer.serialize_str(self.as_str())
6375 }
6376}
6377#[cfg(feature = "deserialize")]
6378impl<'de> serde::Deserialize<'de>
6379 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6380{
6381 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6382 use std::str::FromStr;
6383 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6384 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
6385 }
6386}
6387#[derive(Copy, Clone, Eq, PartialEq)]
6389pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6390 Business,
6391 Personal,
6392}
6393impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6394 pub fn as_str(self) -> &'static str {
6395 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6396 match self {
6397 Business => "business",
6398 Personal => "personal",
6399 }
6400 }
6401}
6402
6403impl std::str::FromStr
6404 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6405{
6406 type Err = stripe_types::StripeParseError;
6407 fn from_str(s: &str) -> Result<Self, Self::Err> {
6408 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6409 match s {
6410 "business" => Ok(Business),
6411 "personal" => Ok(Personal),
6412 _ => Err(stripe_types::StripeParseError),
6413 }
6414 }
6415}
6416impl std::fmt::Display
6417 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6418{
6419 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6420 f.write_str(self.as_str())
6421 }
6422}
6423
6424impl std::fmt::Debug
6425 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6426{
6427 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6428 f.write_str(self.as_str())
6429 }
6430}
6431impl serde::Serialize
6432 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6433{
6434 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6435 where
6436 S: serde::Serializer,
6437 {
6438 serializer.serialize_str(self.as_str())
6439 }
6440}
6441#[cfg(feature = "deserialize")]
6442impl<'de> serde::Deserialize<'de>
6443 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6444{
6445 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6446 use std::str::FromStr;
6447 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6448 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
6449 }
6450}
6451#[derive(Copy, Clone, Eq, PartialEq)]
6453pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6454 Automatic,
6455 Instant,
6456 Microdeposits,
6457}
6458impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6459 pub fn as_str(self) -> &'static str {
6460 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6461 match self {
6462 Automatic => "automatic",
6463 Instant => "instant",
6464 Microdeposits => "microdeposits",
6465 }
6466 }
6467}
6468
6469impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6470 type Err = stripe_types::StripeParseError;
6471 fn from_str(s: &str) -> Result<Self, Self::Err> {
6472 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6473 match s {
6474 "automatic" => Ok(Automatic),
6475 "instant" => Ok(Instant),
6476 "microdeposits" => Ok(Microdeposits),
6477 _ => Err(stripe_types::StripeParseError),
6478 }
6479 }
6480}
6481impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6482 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6483 f.write_str(self.as_str())
6484 }
6485}
6486
6487impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6488 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6489 f.write_str(self.as_str())
6490 }
6491}
6492impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6493 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6494 where
6495 S: serde::Serializer,
6496 {
6497 serializer.serialize_str(self.as_str())
6498 }
6499}
6500#[cfg(feature = "deserialize")]
6501impl<'de> serde::Deserialize<'de>
6502 for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
6503{
6504 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6505 use std::str::FromStr;
6506 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6507 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
6508 }
6509}
6510#[derive(Clone, Debug, serde::Serialize)]
6512pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6513 #[serde(skip_serializing_if = "Option::is_none")]
6515 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
6516}
6517impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6518 pub fn new() -> Self {
6519 Self { mandate_options: None }
6520 }
6521}
6522impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6523 fn default() -> Self {
6524 Self::new()
6525 }
6526}
6527#[derive(Clone, Debug, serde::Serialize)]
6529pub struct UpdateSetupIntentPaymentMethodOptionsCard {
6530 #[serde(skip_serializing_if = "Option::is_none")]
6532 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
6533 #[serde(skip_serializing_if = "Option::is_none")]
6537 pub moto: Option<bool>,
6538 #[serde(skip_serializing_if = "Option::is_none")]
6542 pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
6543 #[serde(skip_serializing_if = "Option::is_none")]
6548 pub request_three_d_secure:
6549 Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
6550 #[serde(skip_serializing_if = "Option::is_none")]
6553 pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
6554}
6555impl UpdateSetupIntentPaymentMethodOptionsCard {
6556 pub fn new() -> Self {
6557 Self {
6558 mandate_options: None,
6559 moto: None,
6560 network: None,
6561 request_three_d_secure: None,
6562 three_d_secure: None,
6563 }
6564 }
6565}
6566impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
6567 fn default() -> Self {
6568 Self::new()
6569 }
6570}
6571#[derive(Clone, Debug, serde::Serialize)]
6573pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6574 pub amount: i64,
6576 pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
6580 pub currency: stripe_types::Currency,
6584 #[serde(skip_serializing_if = "Option::is_none")]
6586 pub description: Option<String>,
6587 #[serde(skip_serializing_if = "Option::is_none")]
6591 pub end_date: Option<stripe_types::Timestamp>,
6592 pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
6594 #[serde(skip_serializing_if = "Option::is_none")]
6599 pub interval_count: Option<u64>,
6600 pub reference: String,
6602 pub start_date: stripe_types::Timestamp,
6604 #[serde(skip_serializing_if = "Option::is_none")]
6606 pub supported_types:
6607 Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
6608}
6609impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6610 pub fn new(
6611 amount: impl Into<i64>,
6612 amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
6613 currency: impl Into<stripe_types::Currency>,
6614 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
6615 reference: impl Into<String>,
6616 start_date: impl Into<stripe_types::Timestamp>,
6617 ) -> Self {
6618 Self {
6619 amount: amount.into(),
6620 amount_type: amount_type.into(),
6621 currency: currency.into(),
6622 description: None,
6623 end_date: None,
6624 interval: interval.into(),
6625 interval_count: None,
6626 reference: reference.into(),
6627 start_date: start_date.into(),
6628 supported_types: None,
6629 }
6630 }
6631}
6632#[derive(Copy, Clone, Eq, PartialEq)]
6636pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6637 Fixed,
6638 Maximum,
6639}
6640impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6641 pub fn as_str(self) -> &'static str {
6642 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6643 match self {
6644 Fixed => "fixed",
6645 Maximum => "maximum",
6646 }
6647 }
6648}
6649
6650impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6651 type Err = stripe_types::StripeParseError;
6652 fn from_str(s: &str) -> Result<Self, Self::Err> {
6653 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6654 match s {
6655 "fixed" => Ok(Fixed),
6656 "maximum" => Ok(Maximum),
6657 _ => Err(stripe_types::StripeParseError),
6658 }
6659 }
6660}
6661impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6662 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6663 f.write_str(self.as_str())
6664 }
6665}
6666
6667impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6668 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6669 f.write_str(self.as_str())
6670 }
6671}
6672impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6673 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6674 where
6675 S: serde::Serializer,
6676 {
6677 serializer.serialize_str(self.as_str())
6678 }
6679}
6680#[cfg(feature = "deserialize")]
6681impl<'de> serde::Deserialize<'de>
6682 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
6683{
6684 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6685 use std::str::FromStr;
6686 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6687 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
6688 }
6689}
6690#[derive(Copy, Clone, Eq, PartialEq)]
6692pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6693 Day,
6694 Month,
6695 Sporadic,
6696 Week,
6697 Year,
6698}
6699impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6700 pub fn as_str(self) -> &'static str {
6701 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6702 match self {
6703 Day => "day",
6704 Month => "month",
6705 Sporadic => "sporadic",
6706 Week => "week",
6707 Year => "year",
6708 }
6709 }
6710}
6711
6712impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6713 type Err = stripe_types::StripeParseError;
6714 fn from_str(s: &str) -> Result<Self, Self::Err> {
6715 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6716 match s {
6717 "day" => Ok(Day),
6718 "month" => Ok(Month),
6719 "sporadic" => Ok(Sporadic),
6720 "week" => Ok(Week),
6721 "year" => Ok(Year),
6722 _ => Err(stripe_types::StripeParseError),
6723 }
6724 }
6725}
6726impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6727 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6728 f.write_str(self.as_str())
6729 }
6730}
6731
6732impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6733 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6734 f.write_str(self.as_str())
6735 }
6736}
6737impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6738 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6739 where
6740 S: serde::Serializer,
6741 {
6742 serializer.serialize_str(self.as_str())
6743 }
6744}
6745#[cfg(feature = "deserialize")]
6746impl<'de> serde::Deserialize<'de>
6747 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
6748{
6749 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6750 use std::str::FromStr;
6751 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6752 Self::from_str(&s).map_err(|_| {
6753 serde::de::Error::custom(
6754 "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
6755 )
6756 })
6757 }
6758}
6759#[derive(Copy, Clone, Eq, PartialEq)]
6761pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6762 India,
6763}
6764impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6765 pub fn as_str(self) -> &'static str {
6766 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6767 match self {
6768 India => "india",
6769 }
6770 }
6771}
6772
6773impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6774 type Err = stripe_types::StripeParseError;
6775 fn from_str(s: &str) -> Result<Self, Self::Err> {
6776 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6777 match s {
6778 "india" => Ok(India),
6779 _ => Err(stripe_types::StripeParseError),
6780 }
6781 }
6782}
6783impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6784 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6785 f.write_str(self.as_str())
6786 }
6787}
6788
6789impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6790 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6791 f.write_str(self.as_str())
6792 }
6793}
6794impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6795 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6796 where
6797 S: serde::Serializer,
6798 {
6799 serializer.serialize_str(self.as_str())
6800 }
6801}
6802#[cfg(feature = "deserialize")]
6803impl<'de> serde::Deserialize<'de>
6804 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
6805{
6806 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6807 use std::str::FromStr;
6808 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6809 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
6810 }
6811}
6812#[derive(Copy, Clone, Eq, PartialEq)]
6816pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6817 Amex,
6818 CartesBancaires,
6819 Diners,
6820 Discover,
6821 EftposAu,
6822 Girocard,
6823 Interac,
6824 Jcb,
6825 Link,
6826 Mastercard,
6827 Unionpay,
6828 Unknown,
6829 Visa,
6830}
6831impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6832 pub fn as_str(self) -> &'static str {
6833 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6834 match self {
6835 Amex => "amex",
6836 CartesBancaires => "cartes_bancaires",
6837 Diners => "diners",
6838 Discover => "discover",
6839 EftposAu => "eftpos_au",
6840 Girocard => "girocard",
6841 Interac => "interac",
6842 Jcb => "jcb",
6843 Link => "link",
6844 Mastercard => "mastercard",
6845 Unionpay => "unionpay",
6846 Unknown => "unknown",
6847 Visa => "visa",
6848 }
6849 }
6850}
6851
6852impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6853 type Err = stripe_types::StripeParseError;
6854 fn from_str(s: &str) -> Result<Self, Self::Err> {
6855 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6856 match s {
6857 "amex" => Ok(Amex),
6858 "cartes_bancaires" => Ok(CartesBancaires),
6859 "diners" => Ok(Diners),
6860 "discover" => Ok(Discover),
6861 "eftpos_au" => Ok(EftposAu),
6862 "girocard" => Ok(Girocard),
6863 "interac" => Ok(Interac),
6864 "jcb" => Ok(Jcb),
6865 "link" => Ok(Link),
6866 "mastercard" => Ok(Mastercard),
6867 "unionpay" => Ok(Unionpay),
6868 "unknown" => Ok(Unknown),
6869 "visa" => Ok(Visa),
6870 _ => Err(stripe_types::StripeParseError),
6871 }
6872 }
6873}
6874impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6875 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6876 f.write_str(self.as_str())
6877 }
6878}
6879
6880impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6881 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6882 f.write_str(self.as_str())
6883 }
6884}
6885impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6886 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6887 where
6888 S: serde::Serializer,
6889 {
6890 serializer.serialize_str(self.as_str())
6891 }
6892}
6893#[cfg(feature = "deserialize")]
6894impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6895 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6896 use std::str::FromStr;
6897 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6898 Self::from_str(&s).map_err(|_| {
6899 serde::de::Error::custom(
6900 "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardNetwork",
6901 )
6902 })
6903 }
6904}
6905#[derive(Copy, Clone, Eq, PartialEq)]
6910pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6911 Any,
6912 Automatic,
6913 Challenge,
6914}
6915impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6916 pub fn as_str(self) -> &'static str {
6917 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6918 match self {
6919 Any => "any",
6920 Automatic => "automatic",
6921 Challenge => "challenge",
6922 }
6923 }
6924}
6925
6926impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6927 type Err = stripe_types::StripeParseError;
6928 fn from_str(s: &str) -> Result<Self, Self::Err> {
6929 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6930 match s {
6931 "any" => Ok(Any),
6932 "automatic" => Ok(Automatic),
6933 "challenge" => Ok(Challenge),
6934 _ => Err(stripe_types::StripeParseError),
6935 }
6936 }
6937}
6938impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6939 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6940 f.write_str(self.as_str())
6941 }
6942}
6943
6944impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6945 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6946 f.write_str(self.as_str())
6947 }
6948}
6949impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6950 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6951 where
6952 S: serde::Serializer,
6953 {
6954 serializer.serialize_str(self.as_str())
6955 }
6956}
6957#[cfg(feature = "deserialize")]
6958impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6959 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6960 use std::str::FromStr;
6961 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6962 Self::from_str(&s).map_err(|_| {
6963 serde::de::Error::custom(
6964 "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
6965 )
6966 })
6967 }
6968}
6969#[derive(Clone, Debug, serde::Serialize)]
6972pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
6973 #[serde(skip_serializing_if = "Option::is_none")]
6975 pub ares_trans_status:
6976 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
6977 #[serde(skip_serializing_if = "Option::is_none")]
6982 pub cryptogram: Option<String>,
6983 #[serde(skip_serializing_if = "Option::is_none")]
6986 pub electronic_commerce_indicator:
6987 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
6988 #[serde(skip_serializing_if = "Option::is_none")]
6992 pub network_options:
6993 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
6994 #[serde(skip_serializing_if = "Option::is_none")]
6997 pub requestor_challenge_indicator: Option<String>,
6998 #[serde(skip_serializing_if = "Option::is_none")]
7001 pub transaction_id: Option<String>,
7002 #[serde(skip_serializing_if = "Option::is_none")]
7004 pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
7005}
7006impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7007 pub fn new() -> Self {
7008 Self {
7009 ares_trans_status: None,
7010 cryptogram: None,
7011 electronic_commerce_indicator: None,
7012 network_options: None,
7013 requestor_challenge_indicator: None,
7014 transaction_id: None,
7015 version: None,
7016 }
7017 }
7018}
7019impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7020 fn default() -> Self {
7021 Self::new()
7022 }
7023}
7024#[derive(Copy, Clone, Eq, PartialEq)]
7026pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7027 A,
7028 C,
7029 I,
7030 N,
7031 R,
7032 U,
7033 Y,
7034}
7035impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7036 pub fn as_str(self) -> &'static str {
7037 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7038 match self {
7039 A => "A",
7040 C => "C",
7041 I => "I",
7042 N => "N",
7043 R => "R",
7044 U => "U",
7045 Y => "Y",
7046 }
7047 }
7048}
7049
7050impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7051 type Err = stripe_types::StripeParseError;
7052 fn from_str(s: &str) -> Result<Self, Self::Err> {
7053 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7054 match s {
7055 "A" => Ok(A),
7056 "C" => Ok(C),
7057 "I" => Ok(I),
7058 "N" => Ok(N),
7059 "R" => Ok(R),
7060 "U" => Ok(U),
7061 "Y" => Ok(Y),
7062 _ => Err(stripe_types::StripeParseError),
7063 }
7064 }
7065}
7066impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7067 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7068 f.write_str(self.as_str())
7069 }
7070}
7071
7072impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7073 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7074 f.write_str(self.as_str())
7075 }
7076}
7077impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7078 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7079 where
7080 S: serde::Serializer,
7081 {
7082 serializer.serialize_str(self.as_str())
7083 }
7084}
7085#[cfg(feature = "deserialize")]
7086impl<'de> serde::Deserialize<'de>
7087 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
7088{
7089 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7090 use std::str::FromStr;
7091 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7092 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
7093 }
7094}
7095#[derive(Copy, Clone, Eq, PartialEq)]
7098pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7099 V01,
7100 V02,
7101 V05,
7102 V06,
7103 V07,
7104}
7105impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7106 pub fn as_str(self) -> &'static str {
7107 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7108 match self {
7109 V01 => "01",
7110 V02 => "02",
7111 V05 => "05",
7112 V06 => "06",
7113 V07 => "07",
7114 }
7115 }
7116}
7117
7118impl std::str::FromStr
7119 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7120{
7121 type Err = stripe_types::StripeParseError;
7122 fn from_str(s: &str) -> Result<Self, Self::Err> {
7123 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7124 match s {
7125 "01" => Ok(V01),
7126 "02" => Ok(V02),
7127 "05" => Ok(V05),
7128 "06" => Ok(V06),
7129 "07" => Ok(V07),
7130 _ => Err(stripe_types::StripeParseError),
7131 }
7132 }
7133}
7134impl std::fmt::Display
7135 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7136{
7137 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7138 f.write_str(self.as_str())
7139 }
7140}
7141
7142impl std::fmt::Debug
7143 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7144{
7145 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7146 f.write_str(self.as_str())
7147 }
7148}
7149impl serde::Serialize
7150 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7151{
7152 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7153 where
7154 S: serde::Serializer,
7155 {
7156 serializer.serialize_str(self.as_str())
7157 }
7158}
7159#[cfg(feature = "deserialize")]
7160impl<'de> serde::Deserialize<'de>
7161 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7162{
7163 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7164 use std::str::FromStr;
7165 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7166 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
7167 }
7168}
7169#[derive(Clone, Debug, serde::Serialize)]
7173pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7174 #[serde(skip_serializing_if = "Option::is_none")]
7176 pub cartes_bancaires:
7177 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
7178}
7179impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7180 pub fn new() -> Self {
7181 Self { cartes_bancaires: None }
7182 }
7183}
7184impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7185 fn default() -> Self {
7186 Self::new()
7187 }
7188}
7189#[derive(Clone, Debug, serde::Serialize)]
7191pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7192 pub cb_avalgo:
7196 UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
7197 #[serde(skip_serializing_if = "Option::is_none")]
7202 pub cb_exemption: Option<String>,
7203 #[serde(skip_serializing_if = "Option::is_none")]
7206 pub cb_score: Option<i64>,
7207}
7208impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7209 pub fn new(
7210 cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
7211 ) -> Self {
7212 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
7213 }
7214}
7215#[derive(Copy, Clone, Eq, PartialEq)]
7219pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7220{
7221 V0,
7222 V1,
7223 V2,
7224 V3,
7225 V4,
7226 A,
7227}
7228impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
7229 pub fn as_str(self) -> &'static str {
7230 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7231 match self {
7232 V0 => "0",
7233 V1 => "1",
7234 V2 => "2",
7235 V3 => "3",
7236 V4 => "4",
7237 A => "A",
7238 }
7239 }
7240}
7241
7242impl std::str::FromStr
7243 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7244{
7245 type Err = stripe_types::StripeParseError;
7246 fn from_str(s: &str) -> Result<Self, Self::Err> {
7247 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7248 match s {
7249 "0" => Ok(V0),
7250 "1" => Ok(V1),
7251 "2" => Ok(V2),
7252 "3" => Ok(V3),
7253 "4" => Ok(V4),
7254 "A" => Ok(A),
7255 _ => Err(stripe_types::StripeParseError),
7256 }
7257 }
7258}
7259impl std::fmt::Display
7260 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7261{
7262 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7263 f.write_str(self.as_str())
7264 }
7265}
7266
7267impl std::fmt::Debug
7268 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7269{
7270 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7271 f.write_str(self.as_str())
7272 }
7273}
7274impl serde::Serialize
7275 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7276{
7277 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7278 where
7279 S: serde::Serializer,
7280 {
7281 serializer.serialize_str(self.as_str())
7282 }
7283}
7284#[cfg(feature = "deserialize")]
7285impl<'de> serde::Deserialize<'de>
7286 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7287{
7288 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7289 use std::str::FromStr;
7290 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7291 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
7292 }
7293}
7294#[derive(Copy, Clone, Eq, PartialEq)]
7296pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7297 V1_0_2,
7298 V2_1_0,
7299 V2_2_0,
7300}
7301impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7302 pub fn as_str(self) -> &'static str {
7303 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7304 match self {
7305 V1_0_2 => "1.0.2",
7306 V2_1_0 => "2.1.0",
7307 V2_2_0 => "2.2.0",
7308 }
7309 }
7310}
7311
7312impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7313 type Err = stripe_types::StripeParseError;
7314 fn from_str(s: &str) -> Result<Self, Self::Err> {
7315 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7316 match s {
7317 "1.0.2" => Ok(V1_0_2),
7318 "2.1.0" => Ok(V2_1_0),
7319 "2.2.0" => Ok(V2_2_0),
7320 _ => Err(stripe_types::StripeParseError),
7321 }
7322 }
7323}
7324impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7325 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7326 f.write_str(self.as_str())
7327 }
7328}
7329
7330impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7331 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7332 f.write_str(self.as_str())
7333 }
7334}
7335impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7336 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7337 where
7338 S: serde::Serializer,
7339 {
7340 serializer.serialize_str(self.as_str())
7341 }
7342}
7343#[cfg(feature = "deserialize")]
7344impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7345 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7346 use std::str::FromStr;
7347 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7348 Self::from_str(&s).map_err(|_| {
7349 serde::de::Error::custom(
7350 "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
7351 )
7352 })
7353 }
7354}
7355#[derive(Clone, Debug, serde::Serialize)]
7357pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
7358 #[serde(skip_serializing_if = "Option::is_none")]
7360 pub currency: Option<stripe_types::Currency>,
7361 #[serde(skip_serializing_if = "Option::is_none")]
7363 pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
7364 #[serde(skip_serializing_if = "Option::is_none")]
7366 pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7367 #[serde(skip_serializing_if = "Option::is_none")]
7369 pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7370}
7371impl UpdateSetupIntentPaymentMethodOptionsKlarna {
7372 pub fn new() -> Self {
7373 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
7374 }
7375}
7376impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
7377 fn default() -> Self {
7378 Self::new()
7379 }
7380}
7381#[derive(Copy, Clone, Debug, serde::Serialize)]
7383pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7384 #[serde(skip_serializing_if = "Option::is_none")]
7387 pub average_amount: Option<i64>,
7388 #[serde(skip_serializing_if = "Option::is_none")]
7391 pub maximum_amount: Option<i64>,
7392 #[serde(skip_serializing_if = "Option::is_none")]
7395 pub minimum_amount: Option<i64>,
7396 #[serde(skip_serializing_if = "Option::is_none")]
7398 pub purchase_interval:
7399 Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7400 #[serde(skip_serializing_if = "Option::is_none")]
7402 pub purchase_interval_count: Option<u64>,
7403}
7404impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7405 pub fn new() -> Self {
7406 Self {
7407 average_amount: None,
7408 maximum_amount: None,
7409 minimum_amount: None,
7410 purchase_interval: None,
7411 purchase_interval_count: None,
7412 }
7413 }
7414}
7415impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7416 fn default() -> Self {
7417 Self::new()
7418 }
7419}
7420#[derive(Copy, Clone, Eq, PartialEq)]
7422pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7423 Day,
7424 Month,
7425 Week,
7426 Year,
7427}
7428impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7429 pub fn as_str(self) -> &'static str {
7430 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7431 match self {
7432 Day => "day",
7433 Month => "month",
7434 Week => "week",
7435 Year => "year",
7436 }
7437 }
7438}
7439
7440impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7441 type Err = stripe_types::StripeParseError;
7442 fn from_str(s: &str) -> Result<Self, Self::Err> {
7443 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7444 match s {
7445 "day" => Ok(Day),
7446 "month" => Ok(Month),
7447 "week" => Ok(Week),
7448 "year" => Ok(Year),
7449 _ => Err(stripe_types::StripeParseError),
7450 }
7451 }
7452}
7453impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7454 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7455 f.write_str(self.as_str())
7456 }
7457}
7458
7459impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7460 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7461 f.write_str(self.as_str())
7462 }
7463}
7464impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7465 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7466 where
7467 S: serde::Serializer,
7468 {
7469 serializer.serialize_str(self.as_str())
7470 }
7471}
7472#[cfg(feature = "deserialize")]
7473impl<'de> serde::Deserialize<'de>
7474 for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7475{
7476 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7477 use std::str::FromStr;
7478 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7479 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7480 }
7481}
7482#[derive(Clone, Eq, PartialEq)]
7484#[non_exhaustive]
7485pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7486 CsMinusCz,
7487 DaMinusDk,
7488 DeMinusAt,
7489 DeMinusCh,
7490 DeMinusDe,
7491 ElMinusGr,
7492 EnMinusAt,
7493 EnMinusAu,
7494 EnMinusBe,
7495 EnMinusCa,
7496 EnMinusCh,
7497 EnMinusCz,
7498 EnMinusDe,
7499 EnMinusDk,
7500 EnMinusEs,
7501 EnMinusFi,
7502 EnMinusFr,
7503 EnMinusGb,
7504 EnMinusGr,
7505 EnMinusIe,
7506 EnMinusIt,
7507 EnMinusNl,
7508 EnMinusNo,
7509 EnMinusNz,
7510 EnMinusPl,
7511 EnMinusPt,
7512 EnMinusRo,
7513 EnMinusSe,
7514 EnMinusUs,
7515 EsMinusEs,
7516 EsMinusUs,
7517 FiMinusFi,
7518 FrMinusBe,
7519 FrMinusCa,
7520 FrMinusCh,
7521 FrMinusFr,
7522 ItMinusCh,
7523 ItMinusIt,
7524 NbMinusNo,
7525 NlMinusBe,
7526 NlMinusNl,
7527 PlMinusPl,
7528 PtMinusPt,
7529 RoMinusRo,
7530 SvMinusFi,
7531 SvMinusSe,
7532 Unknown(String),
7534}
7535impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7536 pub fn as_str(&self) -> &str {
7537 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7538 match self {
7539 CsMinusCz => "cs-CZ",
7540 DaMinusDk => "da-DK",
7541 DeMinusAt => "de-AT",
7542 DeMinusCh => "de-CH",
7543 DeMinusDe => "de-DE",
7544 ElMinusGr => "el-GR",
7545 EnMinusAt => "en-AT",
7546 EnMinusAu => "en-AU",
7547 EnMinusBe => "en-BE",
7548 EnMinusCa => "en-CA",
7549 EnMinusCh => "en-CH",
7550 EnMinusCz => "en-CZ",
7551 EnMinusDe => "en-DE",
7552 EnMinusDk => "en-DK",
7553 EnMinusEs => "en-ES",
7554 EnMinusFi => "en-FI",
7555 EnMinusFr => "en-FR",
7556 EnMinusGb => "en-GB",
7557 EnMinusGr => "en-GR",
7558 EnMinusIe => "en-IE",
7559 EnMinusIt => "en-IT",
7560 EnMinusNl => "en-NL",
7561 EnMinusNo => "en-NO",
7562 EnMinusNz => "en-NZ",
7563 EnMinusPl => "en-PL",
7564 EnMinusPt => "en-PT",
7565 EnMinusRo => "en-RO",
7566 EnMinusSe => "en-SE",
7567 EnMinusUs => "en-US",
7568 EsMinusEs => "es-ES",
7569 EsMinusUs => "es-US",
7570 FiMinusFi => "fi-FI",
7571 FrMinusBe => "fr-BE",
7572 FrMinusCa => "fr-CA",
7573 FrMinusCh => "fr-CH",
7574 FrMinusFr => "fr-FR",
7575 ItMinusCh => "it-CH",
7576 ItMinusIt => "it-IT",
7577 NbMinusNo => "nb-NO",
7578 NlMinusBe => "nl-BE",
7579 NlMinusNl => "nl-NL",
7580 PlMinusPl => "pl-PL",
7581 PtMinusPt => "pt-PT",
7582 RoMinusRo => "ro-RO",
7583 SvMinusFi => "sv-FI",
7584 SvMinusSe => "sv-SE",
7585 Unknown(v) => v,
7586 }
7587 }
7588}
7589
7590impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7591 type Err = std::convert::Infallible;
7592 fn from_str(s: &str) -> Result<Self, Self::Err> {
7593 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7594 match s {
7595 "cs-CZ" => Ok(CsMinusCz),
7596 "da-DK" => Ok(DaMinusDk),
7597 "de-AT" => Ok(DeMinusAt),
7598 "de-CH" => Ok(DeMinusCh),
7599 "de-DE" => Ok(DeMinusDe),
7600 "el-GR" => Ok(ElMinusGr),
7601 "en-AT" => Ok(EnMinusAt),
7602 "en-AU" => Ok(EnMinusAu),
7603 "en-BE" => Ok(EnMinusBe),
7604 "en-CA" => Ok(EnMinusCa),
7605 "en-CH" => Ok(EnMinusCh),
7606 "en-CZ" => Ok(EnMinusCz),
7607 "en-DE" => Ok(EnMinusDe),
7608 "en-DK" => Ok(EnMinusDk),
7609 "en-ES" => Ok(EnMinusEs),
7610 "en-FI" => Ok(EnMinusFi),
7611 "en-FR" => Ok(EnMinusFr),
7612 "en-GB" => Ok(EnMinusGb),
7613 "en-GR" => Ok(EnMinusGr),
7614 "en-IE" => Ok(EnMinusIe),
7615 "en-IT" => Ok(EnMinusIt),
7616 "en-NL" => Ok(EnMinusNl),
7617 "en-NO" => Ok(EnMinusNo),
7618 "en-NZ" => Ok(EnMinusNz),
7619 "en-PL" => Ok(EnMinusPl),
7620 "en-PT" => Ok(EnMinusPt),
7621 "en-RO" => Ok(EnMinusRo),
7622 "en-SE" => Ok(EnMinusSe),
7623 "en-US" => Ok(EnMinusUs),
7624 "es-ES" => Ok(EsMinusEs),
7625 "es-US" => Ok(EsMinusUs),
7626 "fi-FI" => Ok(FiMinusFi),
7627 "fr-BE" => Ok(FrMinusBe),
7628 "fr-CA" => Ok(FrMinusCa),
7629 "fr-CH" => Ok(FrMinusCh),
7630 "fr-FR" => Ok(FrMinusFr),
7631 "it-CH" => Ok(ItMinusCh),
7632 "it-IT" => Ok(ItMinusIt),
7633 "nb-NO" => Ok(NbMinusNo),
7634 "nl-BE" => Ok(NlMinusBe),
7635 "nl-NL" => Ok(NlMinusNl),
7636 "pl-PL" => Ok(PlMinusPl),
7637 "pt-PT" => Ok(PtMinusPt),
7638 "ro-RO" => Ok(RoMinusRo),
7639 "sv-FI" => Ok(SvMinusFi),
7640 "sv-SE" => Ok(SvMinusSe),
7641 v => Ok(Unknown(v.to_owned())),
7642 }
7643 }
7644}
7645impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7646 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7647 f.write_str(self.as_str())
7648 }
7649}
7650
7651impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7652 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7653 f.write_str(self.as_str())
7654 }
7655}
7656impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7657 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7658 where
7659 S: serde::Serializer,
7660 {
7661 serializer.serialize_str(self.as_str())
7662 }
7663}
7664#[cfg(feature = "deserialize")]
7665impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7666 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7667 use std::str::FromStr;
7668 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7669 Ok(Self::from_str(&s).unwrap())
7670 }
7671}
7672#[derive(Clone, Debug, serde::Serialize)]
7674pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7675 pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7677 #[serde(skip_serializing_if = "Option::is_none")]
7680 pub interval_count: Option<u64>,
7681 #[serde(skip_serializing_if = "Option::is_none")]
7683 pub name: Option<String>,
7684 pub next_billing: SubscriptionNextBillingParam,
7686 pub reference: String,
7689}
7690impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7691 pub fn new(
7692 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7693 next_billing: impl Into<SubscriptionNextBillingParam>,
7694 reference: impl Into<String>,
7695 ) -> Self {
7696 Self {
7697 interval: interval.into(),
7698 interval_count: None,
7699 name: None,
7700 next_billing: next_billing.into(),
7701 reference: reference.into(),
7702 }
7703 }
7704}
7705#[derive(Copy, Clone, Eq, PartialEq)]
7707pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7708 Day,
7709 Month,
7710 Week,
7711 Year,
7712}
7713impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7714 pub fn as_str(self) -> &'static str {
7715 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7716 match self {
7717 Day => "day",
7718 Month => "month",
7719 Week => "week",
7720 Year => "year",
7721 }
7722 }
7723}
7724
7725impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7726 type Err = stripe_types::StripeParseError;
7727 fn from_str(s: &str) -> Result<Self, Self::Err> {
7728 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7729 match s {
7730 "day" => Ok(Day),
7731 "month" => Ok(Month),
7732 "week" => Ok(Week),
7733 "year" => Ok(Year),
7734 _ => Err(stripe_types::StripeParseError),
7735 }
7736 }
7737}
7738impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7739 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7740 f.write_str(self.as_str())
7741 }
7742}
7743
7744impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7745 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7746 f.write_str(self.as_str())
7747 }
7748}
7749impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7750 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7751 where
7752 S: serde::Serializer,
7753 {
7754 serializer.serialize_str(self.as_str())
7755 }
7756}
7757#[cfg(feature = "deserialize")]
7758impl<'de> serde::Deserialize<'de>
7759 for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7760{
7761 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7762 use std::str::FromStr;
7763 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7764 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7765 }
7766}
7767#[derive(Clone, Debug, serde::Serialize)]
7769pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7770 #[serde(skip_serializing_if = "Option::is_none")]
7772 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
7773}
7774impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7775 pub fn new() -> Self {
7776 Self { mandate_options: None }
7777 }
7778}
7779impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7780 fn default() -> Self {
7781 Self::new()
7782 }
7783}
7784#[derive(Clone, Debug, serde::Serialize)]
7786pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7787 #[serde(skip_serializing_if = "Option::is_none")]
7792 pub reference_prefix: Option<String>,
7793}
7794impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7795 pub fn new() -> Self {
7796 Self { reference_prefix: None }
7797 }
7798}
7799impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7800 fn default() -> Self {
7801 Self::new()
7802 }
7803}
7804#[derive(Clone, Debug, serde::Serialize)]
7806pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7807 #[serde(skip_serializing_if = "Option::is_none")]
7809 pub financial_connections:
7810 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
7811 #[serde(skip_serializing_if = "Option::is_none")]
7813 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
7814 #[serde(skip_serializing_if = "Option::is_none")]
7816 pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
7817 #[serde(skip_serializing_if = "Option::is_none")]
7819 pub verification_method:
7820 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
7821}
7822impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7823 pub fn new() -> Self {
7824 Self {
7825 financial_connections: None,
7826 mandate_options: None,
7827 networks: None,
7828 verification_method: None,
7829 }
7830 }
7831}
7832impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7833 fn default() -> Self {
7834 Self::new()
7835 }
7836}
7837#[derive(Clone, Debug, serde::Serialize)]
7839pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7840 #[serde(skip_serializing_if = "Option::is_none")]
7842 pub filters:
7843 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
7844 #[serde(skip_serializing_if = "Option::is_none")]
7848 pub permissions: Option<
7849 Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
7850 >,
7851 #[serde(skip_serializing_if = "Option::is_none")]
7853 pub prefetch:
7854 Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
7855 #[serde(skip_serializing_if = "Option::is_none")]
7858 pub return_url: Option<String>,
7859}
7860impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7861 pub fn new() -> Self {
7862 Self { filters: None, permissions: None, prefetch: None, return_url: None }
7863 }
7864}
7865impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7866 fn default() -> Self {
7867 Self::new()
7868 }
7869}
7870#[derive(Clone, Debug, serde::Serialize)]
7872pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7873 #[serde(skip_serializing_if = "Option::is_none")]
7876pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
7877
7878}
7879impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7880 pub fn new() -> Self {
7881 Self { account_subcategories: None }
7882 }
7883}
7884impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7885 fn default() -> Self {
7886 Self::new()
7887 }
7888}
7889#[derive(Copy, Clone, Eq, PartialEq)]
7892pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
7893{
7894 Checking,
7895 Savings,
7896}
7897impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7898 pub fn as_str(self) -> &'static str {
7899 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7900 match self {
7901Checking => "checking",
7902Savings => "savings",
7903
7904 }
7905 }
7906}
7907
7908impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7909 type Err = stripe_types::StripeParseError;
7910 fn from_str(s: &str) -> Result<Self, Self::Err> {
7911 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7912 match s {
7913 "checking" => Ok(Checking),
7914"savings" => Ok(Savings),
7915_ => Err(stripe_types::StripeParseError)
7916
7917 }
7918 }
7919}
7920impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7921 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7922 f.write_str(self.as_str())
7923 }
7924}
7925
7926impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7927 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7928 f.write_str(self.as_str())
7929 }
7930}
7931impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7932 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
7933 serializer.serialize_str(self.as_str())
7934 }
7935}
7936#[cfg(feature = "deserialize")]
7937impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7938 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7939 use std::str::FromStr;
7940 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7941 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
7942 }
7943}
7944#[derive(Copy, Clone, Eq, PartialEq)]
7948pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7949 Balances,
7950 Ownership,
7951 PaymentMethod,
7952 Transactions,
7953}
7954impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7955 pub fn as_str(self) -> &'static str {
7956 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7957 match self {
7958 Balances => "balances",
7959 Ownership => "ownership",
7960 PaymentMethod => "payment_method",
7961 Transactions => "transactions",
7962 }
7963 }
7964}
7965
7966impl std::str::FromStr
7967 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7968{
7969 type Err = stripe_types::StripeParseError;
7970 fn from_str(s: &str) -> Result<Self, Self::Err> {
7971 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7972 match s {
7973 "balances" => Ok(Balances),
7974 "ownership" => Ok(Ownership),
7975 "payment_method" => Ok(PaymentMethod),
7976 "transactions" => Ok(Transactions),
7977 _ => Err(stripe_types::StripeParseError),
7978 }
7979 }
7980}
7981impl std::fmt::Display
7982 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7983{
7984 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7985 f.write_str(self.as_str())
7986 }
7987}
7988
7989impl std::fmt::Debug
7990 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7991{
7992 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7993 f.write_str(self.as_str())
7994 }
7995}
7996impl serde::Serialize
7997 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7998{
7999 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8000 where
8001 S: serde::Serializer,
8002 {
8003 serializer.serialize_str(self.as_str())
8004 }
8005}
8006#[cfg(feature = "deserialize")]
8007impl<'de> serde::Deserialize<'de>
8008 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8009{
8010 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8011 use std::str::FromStr;
8012 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8013 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
8014 }
8015}
8016#[derive(Copy, Clone, Eq, PartialEq)]
8018pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8019 Balances,
8020 Ownership,
8021 Transactions,
8022}
8023impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8024 pub fn as_str(self) -> &'static str {
8025 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8026 match self {
8027 Balances => "balances",
8028 Ownership => "ownership",
8029 Transactions => "transactions",
8030 }
8031 }
8032}
8033
8034impl std::str::FromStr
8035 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8036{
8037 type Err = stripe_types::StripeParseError;
8038 fn from_str(s: &str) -> Result<Self, Self::Err> {
8039 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8040 match s {
8041 "balances" => Ok(Balances),
8042 "ownership" => Ok(Ownership),
8043 "transactions" => Ok(Transactions),
8044 _ => Err(stripe_types::StripeParseError),
8045 }
8046 }
8047}
8048impl std::fmt::Display
8049 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8050{
8051 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8052 f.write_str(self.as_str())
8053 }
8054}
8055
8056impl std::fmt::Debug
8057 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8058{
8059 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8060 f.write_str(self.as_str())
8061 }
8062}
8063impl serde::Serialize
8064 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8065{
8066 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8067 where
8068 S: serde::Serializer,
8069 {
8070 serializer.serialize_str(self.as_str())
8071 }
8072}
8073#[cfg(feature = "deserialize")]
8074impl<'de> serde::Deserialize<'de>
8075 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8076{
8077 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8078 use std::str::FromStr;
8079 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8080 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
8081 }
8082}
8083#[derive(Copy, Clone, Debug, serde::Serialize)]
8085pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8086 #[serde(skip_serializing_if = "Option::is_none")]
8088 pub collection_method:
8089 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
8090}
8091impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8092 pub fn new() -> Self {
8093 Self { collection_method: None }
8094 }
8095}
8096impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8097 fn default() -> Self {
8098 Self::new()
8099 }
8100}
8101#[derive(Copy, Clone, Eq, PartialEq)]
8103pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8104 Paper,
8105}
8106impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8107 pub fn as_str(self) -> &'static str {
8108 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8109 match self {
8110 Paper => "paper",
8111 }
8112 }
8113}
8114
8115impl std::str::FromStr
8116 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8117{
8118 type Err = stripe_types::StripeParseError;
8119 fn from_str(s: &str) -> Result<Self, Self::Err> {
8120 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8121 match s {
8122 "paper" => Ok(Paper),
8123 _ => Err(stripe_types::StripeParseError),
8124 }
8125 }
8126}
8127impl std::fmt::Display
8128 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8129{
8130 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8131 f.write_str(self.as_str())
8132 }
8133}
8134
8135impl std::fmt::Debug
8136 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8137{
8138 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8139 f.write_str(self.as_str())
8140 }
8141}
8142impl serde::Serialize
8143 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8144{
8145 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8146 where
8147 S: serde::Serializer,
8148 {
8149 serializer.serialize_str(self.as_str())
8150 }
8151}
8152#[cfg(feature = "deserialize")]
8153impl<'de> serde::Deserialize<'de>
8154 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8155{
8156 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8157 use std::str::FromStr;
8158 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8159 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
8160 }
8161}
8162#[derive(Clone, Debug, serde::Serialize)]
8164pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8165 #[serde(skip_serializing_if = "Option::is_none")]
8167 pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
8168}
8169impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8170 pub fn new() -> Self {
8171 Self { requested: None }
8172 }
8173}
8174impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8175 fn default() -> Self {
8176 Self::new()
8177 }
8178}
8179#[derive(Copy, Clone, Eq, PartialEq)]
8181pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8182 Ach,
8183 UsDomesticWire,
8184}
8185impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8186 pub fn as_str(self) -> &'static str {
8187 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8188 match self {
8189 Ach => "ach",
8190 UsDomesticWire => "us_domestic_wire",
8191 }
8192 }
8193}
8194
8195impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8196 type Err = stripe_types::StripeParseError;
8197 fn from_str(s: &str) -> Result<Self, Self::Err> {
8198 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8199 match s {
8200 "ach" => Ok(Ach),
8201 "us_domestic_wire" => Ok(UsDomesticWire),
8202 _ => Err(stripe_types::StripeParseError),
8203 }
8204 }
8205}
8206impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8207 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8208 f.write_str(self.as_str())
8209 }
8210}
8211
8212impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8213 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8214 f.write_str(self.as_str())
8215 }
8216}
8217impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8218 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8219 where
8220 S: serde::Serializer,
8221 {
8222 serializer.serialize_str(self.as_str())
8223 }
8224}
8225#[cfg(feature = "deserialize")]
8226impl<'de> serde::Deserialize<'de>
8227 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
8228{
8229 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8230 use std::str::FromStr;
8231 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8232 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
8233 }
8234}
8235#[derive(Copy, Clone, Eq, PartialEq)]
8237pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8238 Automatic,
8239 Instant,
8240 Microdeposits,
8241}
8242impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8243 pub fn as_str(self) -> &'static str {
8244 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8245 match self {
8246 Automatic => "automatic",
8247 Instant => "instant",
8248 Microdeposits => "microdeposits",
8249 }
8250 }
8251}
8252
8253impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8254 type Err = stripe_types::StripeParseError;
8255 fn from_str(s: &str) -> Result<Self, Self::Err> {
8256 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8257 match s {
8258 "automatic" => Ok(Automatic),
8259 "instant" => Ok(Instant),
8260 "microdeposits" => Ok(Microdeposits),
8261 _ => Err(stripe_types::StripeParseError),
8262 }
8263 }
8264}
8265impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8266 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8267 f.write_str(self.as_str())
8268 }
8269}
8270
8271impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8272 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8273 f.write_str(self.as_str())
8274 }
8275}
8276impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8277 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8278 where
8279 S: serde::Serializer,
8280 {
8281 serializer.serialize_str(self.as_str())
8282 }
8283}
8284#[cfg(feature = "deserialize")]
8285impl<'de> serde::Deserialize<'de>
8286 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
8287{
8288 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8289 use std::str::FromStr;
8290 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8291 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
8292 }
8293}
8294#[derive(Clone, Debug, serde::Serialize)]
8296pub struct UpdateSetupIntent {
8297 inner: UpdateSetupIntentBuilder,
8298 intent: stripe_shared::SetupIntentId,
8299}
8300impl UpdateSetupIntent {
8301 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8303 Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
8304 }
8305 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
8310 self.inner.attach_to_self = Some(attach_to_self.into());
8311 self
8312 }
8313 pub fn customer(mut self, customer: impl Into<String>) -> Self {
8318 self.inner.customer = Some(customer.into());
8319 self
8320 }
8321 pub fn description(mut self, description: impl Into<String>) -> Self {
8323 self.inner.description = Some(description.into());
8324 self
8325 }
8326 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8328 self.inner.expand = Some(expand.into());
8329 self
8330 }
8331 pub fn flow_directions(
8337 mut self,
8338 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
8339 ) -> Self {
8340 self.inner.flow_directions = Some(flow_directions.into());
8341 self
8342 }
8343 pub fn metadata(
8348 mut self,
8349 metadata: impl Into<std::collections::HashMap<String, String>>,
8350 ) -> Self {
8351 self.inner.metadata = Some(metadata.into());
8352 self
8353 }
8354 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
8357 self.inner.payment_method = Some(payment_method.into());
8358 self
8359 }
8360 pub fn payment_method_configuration(
8362 mut self,
8363 payment_method_configuration: impl Into<String>,
8364 ) -> Self {
8365 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
8366 self
8367 }
8368 pub fn payment_method_data(
8371 mut self,
8372 payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
8373 ) -> Self {
8374 self.inner.payment_method_data = Some(payment_method_data.into());
8375 self
8376 }
8377 pub fn payment_method_options(
8379 mut self,
8380 payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
8381 ) -> Self {
8382 self.inner.payment_method_options = Some(payment_method_options.into());
8383 self
8384 }
8385 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
8389 self.inner.payment_method_types = Some(payment_method_types.into());
8390 self
8391 }
8392}
8393impl UpdateSetupIntent {
8394 pub async fn send<C: StripeClient>(
8396 &self,
8397 client: &C,
8398 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8399 self.customize().send(client).await
8400 }
8401
8402 pub fn send_blocking<C: StripeBlockingClient>(
8404 &self,
8405 client: &C,
8406 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8407 self.customize().send_blocking(client)
8408 }
8409}
8410
8411impl StripeRequest for UpdateSetupIntent {
8412 type Output = stripe_shared::SetupIntent;
8413
8414 fn build(&self) -> RequestBuilder {
8415 let intent = &self.intent;
8416 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
8417 .form(&self.inner)
8418 }
8419}
8420#[derive(Clone, Debug, serde::Serialize)]
8421struct CancelSetupIntentBuilder {
8422 #[serde(skip_serializing_if = "Option::is_none")]
8423 cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
8424 #[serde(skip_serializing_if = "Option::is_none")]
8425 expand: Option<Vec<String>>,
8426}
8427impl CancelSetupIntentBuilder {
8428 fn new() -> Self {
8429 Self { cancellation_reason: None, expand: None }
8430 }
8431}
8432#[derive(Clone, Debug, serde::Serialize)]
8439pub struct CancelSetupIntent {
8440 inner: CancelSetupIntentBuilder,
8441 intent: stripe_shared::SetupIntentId,
8442}
8443impl CancelSetupIntent {
8444 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8446 Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
8447 }
8448 pub fn cancellation_reason(
8451 mut self,
8452 cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
8453 ) -> Self {
8454 self.inner.cancellation_reason = Some(cancellation_reason.into());
8455 self
8456 }
8457 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8459 self.inner.expand = Some(expand.into());
8460 self
8461 }
8462}
8463impl CancelSetupIntent {
8464 pub async fn send<C: StripeClient>(
8466 &self,
8467 client: &C,
8468 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8469 self.customize().send(client).await
8470 }
8471
8472 pub fn send_blocking<C: StripeBlockingClient>(
8474 &self,
8475 client: &C,
8476 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8477 self.customize().send_blocking(client)
8478 }
8479}
8480
8481impl StripeRequest for CancelSetupIntent {
8482 type Output = stripe_shared::SetupIntent;
8483
8484 fn build(&self) -> RequestBuilder {
8485 let intent = &self.intent;
8486 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
8487 .form(&self.inner)
8488 }
8489}
8490#[derive(Clone, Debug, serde::Serialize)]
8491struct ConfirmSetupIntentBuilder {
8492 #[serde(skip_serializing_if = "Option::is_none")]
8493 confirmation_token: Option<String>,
8494 #[serde(skip_serializing_if = "Option::is_none")]
8495 expand: Option<Vec<String>>,
8496 #[serde(skip_serializing_if = "Option::is_none")]
8497 mandate_data: Option<ConfirmSetupIntentMandateData>,
8498 #[serde(skip_serializing_if = "Option::is_none")]
8499 payment_method: Option<String>,
8500 #[serde(skip_serializing_if = "Option::is_none")]
8501 payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
8502 #[serde(skip_serializing_if = "Option::is_none")]
8503 payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
8504 #[serde(skip_serializing_if = "Option::is_none")]
8505 return_url: Option<String>,
8506 #[serde(skip_serializing_if = "Option::is_none")]
8507 use_stripe_sdk: Option<bool>,
8508}
8509impl ConfirmSetupIntentBuilder {
8510 fn new() -> Self {
8511 Self {
8512 confirmation_token: None,
8513 expand: None,
8514 mandate_data: None,
8515 payment_method: None,
8516 payment_method_data: None,
8517 payment_method_options: None,
8518 return_url: None,
8519 use_stripe_sdk: None,
8520 }
8521 }
8522}
8523#[derive(Clone, Debug, serde::Serialize)]
8524#[serde(rename_all = "snake_case")]
8525pub enum ConfirmSetupIntentMandateData {
8526 #[serde(untagged)]
8527 SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
8528 #[serde(untagged)]
8529 ClientKeyParam(ConfirmSetupIntentClientKeyParam),
8530}
8531#[derive(Clone, Debug, serde::Serialize)]
8532pub struct ConfirmSetupIntentSecretKeyParam {
8533 pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
8535}
8536impl ConfirmSetupIntentSecretKeyParam {
8537 pub fn new(
8538 customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
8539 ) -> Self {
8540 Self { customer_acceptance: customer_acceptance.into() }
8541 }
8542}
8543#[derive(Clone, Debug, serde::Serialize)]
8545pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8546 #[serde(skip_serializing_if = "Option::is_none")]
8548 pub accepted_at: Option<stripe_types::Timestamp>,
8549 #[serde(skip_serializing_if = "Option::is_none")]
8551 #[serde(with = "stripe_types::with_serde_json_opt")]
8552 pub offline: Option<miniserde::json::Value>,
8553 #[serde(skip_serializing_if = "Option::is_none")]
8555 pub online: Option<OnlineParam>,
8556 #[serde(rename = "type")]
8559 pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
8560}
8561impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8562 pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
8563 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
8564 }
8565}
8566#[derive(Copy, Clone, Eq, PartialEq)]
8569pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8570 Offline,
8571 Online,
8572}
8573impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8574 pub fn as_str(self) -> &'static str {
8575 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8576 match self {
8577 Offline => "offline",
8578 Online => "online",
8579 }
8580 }
8581}
8582
8583impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8584 type Err = stripe_types::StripeParseError;
8585 fn from_str(s: &str) -> Result<Self, Self::Err> {
8586 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8587 match s {
8588 "offline" => Ok(Offline),
8589 "online" => Ok(Online),
8590 _ => Err(stripe_types::StripeParseError),
8591 }
8592 }
8593}
8594impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8595 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8596 f.write_str(self.as_str())
8597 }
8598}
8599
8600impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8601 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8602 f.write_str(self.as_str())
8603 }
8604}
8605impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8606 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8607 where
8608 S: serde::Serializer,
8609 {
8610 serializer.serialize_str(self.as_str())
8611 }
8612}
8613#[cfg(feature = "deserialize")]
8614impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8615 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8616 use std::str::FromStr;
8617 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8618 Self::from_str(&s).map_err(|_| {
8619 serde::de::Error::custom(
8620 "Unknown value for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType",
8621 )
8622 })
8623 }
8624}
8625#[derive(Clone, Debug, serde::Serialize)]
8626pub struct ConfirmSetupIntentClientKeyParam {
8627 pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
8629}
8630impl ConfirmSetupIntentClientKeyParam {
8631 pub fn new(
8632 customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
8633 ) -> Self {
8634 Self { customer_acceptance: customer_acceptance.into() }
8635 }
8636}
8637#[derive(Clone, Debug, serde::Serialize)]
8639pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8640 pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
8642 #[serde(rename = "type")]
8644 pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
8645}
8646impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8647 pub fn new(
8648 online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
8649 type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
8650 ) -> Self {
8651 Self { online: online.into(), type_: type_.into() }
8652 }
8653}
8654#[derive(Clone, Debug, serde::Serialize)]
8656pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8657 #[serde(skip_serializing_if = "Option::is_none")]
8659 pub ip_address: Option<String>,
8660 #[serde(skip_serializing_if = "Option::is_none")]
8662 pub user_agent: Option<String>,
8663}
8664impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8665 pub fn new() -> Self {
8666 Self { ip_address: None, user_agent: None }
8667 }
8668}
8669impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8670 fn default() -> Self {
8671 Self::new()
8672 }
8673}
8674#[derive(Copy, Clone, Eq, PartialEq)]
8676pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8677 Online,
8678}
8679impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8680 pub fn as_str(self) -> &'static str {
8681 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8682 match self {
8683 Online => "online",
8684 }
8685 }
8686}
8687
8688impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8689 type Err = stripe_types::StripeParseError;
8690 fn from_str(s: &str) -> Result<Self, Self::Err> {
8691 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8692 match s {
8693 "online" => Ok(Online),
8694 _ => Err(stripe_types::StripeParseError),
8695 }
8696 }
8697}
8698impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8699 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8700 f.write_str(self.as_str())
8701 }
8702}
8703
8704impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8705 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8706 f.write_str(self.as_str())
8707 }
8708}
8709impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8710 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8711 where
8712 S: serde::Serializer,
8713 {
8714 serializer.serialize_str(self.as_str())
8715 }
8716}
8717#[cfg(feature = "deserialize")]
8718impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8719 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8720 use std::str::FromStr;
8721 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8722 Self::from_str(&s).map_err(|_| {
8723 serde::de::Error::custom(
8724 "Unknown value for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType",
8725 )
8726 })
8727 }
8728}
8729#[derive(Clone, Debug, serde::Serialize)]
8732pub struct ConfirmSetupIntentPaymentMethodData {
8733 #[serde(skip_serializing_if = "Option::is_none")]
8735 pub acss_debit: Option<PaymentMethodParam>,
8736 #[serde(skip_serializing_if = "Option::is_none")]
8738 #[serde(with = "stripe_types::with_serde_json_opt")]
8739 pub affirm: Option<miniserde::json::Value>,
8740 #[serde(skip_serializing_if = "Option::is_none")]
8742 #[serde(with = "stripe_types::with_serde_json_opt")]
8743 pub afterpay_clearpay: Option<miniserde::json::Value>,
8744 #[serde(skip_serializing_if = "Option::is_none")]
8746 #[serde(with = "stripe_types::with_serde_json_opt")]
8747 pub alipay: Option<miniserde::json::Value>,
8748 #[serde(skip_serializing_if = "Option::is_none")]
8752 pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
8753 #[serde(skip_serializing_if = "Option::is_none")]
8755 #[serde(with = "stripe_types::with_serde_json_opt")]
8756 pub alma: Option<miniserde::json::Value>,
8757 #[serde(skip_serializing_if = "Option::is_none")]
8759 #[serde(with = "stripe_types::with_serde_json_opt")]
8760 pub amazon_pay: Option<miniserde::json::Value>,
8761 #[serde(skip_serializing_if = "Option::is_none")]
8763 pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
8764 #[serde(skip_serializing_if = "Option::is_none")]
8766 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
8767 #[serde(skip_serializing_if = "Option::is_none")]
8769 #[serde(with = "stripe_types::with_serde_json_opt")]
8770 pub bancontact: Option<miniserde::json::Value>,
8771 #[serde(skip_serializing_if = "Option::is_none")]
8773 #[serde(with = "stripe_types::with_serde_json_opt")]
8774 pub billie: Option<miniserde::json::Value>,
8775 #[serde(skip_serializing_if = "Option::is_none")]
8777 pub billing_details: Option<BillingDetailsInnerParams>,
8778 #[serde(skip_serializing_if = "Option::is_none")]
8780 #[serde(with = "stripe_types::with_serde_json_opt")]
8781 pub blik: Option<miniserde::json::Value>,
8782 #[serde(skip_serializing_if = "Option::is_none")]
8784 pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
8785 #[serde(skip_serializing_if = "Option::is_none")]
8787 #[serde(with = "stripe_types::with_serde_json_opt")]
8788 pub cashapp: Option<miniserde::json::Value>,
8789 #[serde(skip_serializing_if = "Option::is_none")]
8791 #[serde(with = "stripe_types::with_serde_json_opt")]
8792 pub crypto: Option<miniserde::json::Value>,
8793 #[serde(skip_serializing_if = "Option::is_none")]
8795 #[serde(with = "stripe_types::with_serde_json_opt")]
8796 pub customer_balance: Option<miniserde::json::Value>,
8797 #[serde(skip_serializing_if = "Option::is_none")]
8799 pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
8800 #[serde(skip_serializing_if = "Option::is_none")]
8802 pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
8803 #[serde(skip_serializing_if = "Option::is_none")]
8805 #[serde(with = "stripe_types::with_serde_json_opt")]
8806 pub giropay: Option<miniserde::json::Value>,
8807 #[serde(skip_serializing_if = "Option::is_none")]
8809 #[serde(with = "stripe_types::with_serde_json_opt")]
8810 pub grabpay: Option<miniserde::json::Value>,
8811 #[serde(skip_serializing_if = "Option::is_none")]
8813 pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
8814 #[serde(skip_serializing_if = "Option::is_none")]
8816 #[serde(with = "stripe_types::with_serde_json_opt")]
8817 pub interac_present: Option<miniserde::json::Value>,
8818 #[serde(skip_serializing_if = "Option::is_none")]
8820 #[serde(with = "stripe_types::with_serde_json_opt")]
8821 pub kakao_pay: Option<miniserde::json::Value>,
8822 #[serde(skip_serializing_if = "Option::is_none")]
8824 pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
8825 #[serde(skip_serializing_if = "Option::is_none")]
8827 #[serde(with = "stripe_types::with_serde_json_opt")]
8828 pub konbini: Option<miniserde::json::Value>,
8829 #[serde(skip_serializing_if = "Option::is_none")]
8831 #[serde(with = "stripe_types::with_serde_json_opt")]
8832 pub kr_card: Option<miniserde::json::Value>,
8833 #[serde(skip_serializing_if = "Option::is_none")]
8835 #[serde(with = "stripe_types::with_serde_json_opt")]
8836 pub link: Option<miniserde::json::Value>,
8837 #[serde(skip_serializing_if = "Option::is_none")]
8839 #[serde(with = "stripe_types::with_serde_json_opt")]
8840 pub mb_way: Option<miniserde::json::Value>,
8841 #[serde(skip_serializing_if = "Option::is_none")]
8846 pub metadata: Option<std::collections::HashMap<String, String>>,
8847 #[serde(skip_serializing_if = "Option::is_none")]
8849 #[serde(with = "stripe_types::with_serde_json_opt")]
8850 pub mobilepay: Option<miniserde::json::Value>,
8851 #[serde(skip_serializing_if = "Option::is_none")]
8853 #[serde(with = "stripe_types::with_serde_json_opt")]
8854 pub multibanco: Option<miniserde::json::Value>,
8855 #[serde(skip_serializing_if = "Option::is_none")]
8857 pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
8858 #[serde(skip_serializing_if = "Option::is_none")]
8860 pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
8861 #[serde(skip_serializing_if = "Option::is_none")]
8863 #[serde(with = "stripe_types::with_serde_json_opt")]
8864 pub oxxo: Option<miniserde::json::Value>,
8865 #[serde(skip_serializing_if = "Option::is_none")]
8867 pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
8868 #[serde(skip_serializing_if = "Option::is_none")]
8870 #[serde(with = "stripe_types::with_serde_json_opt")]
8871 pub pay_by_bank: Option<miniserde::json::Value>,
8872 #[serde(skip_serializing_if = "Option::is_none")]
8874 #[serde(with = "stripe_types::with_serde_json_opt")]
8875 pub payco: Option<miniserde::json::Value>,
8876 #[serde(skip_serializing_if = "Option::is_none")]
8878 #[serde(with = "stripe_types::with_serde_json_opt")]
8879 pub paynow: Option<miniserde::json::Value>,
8880 #[serde(skip_serializing_if = "Option::is_none")]
8882 #[serde(with = "stripe_types::with_serde_json_opt")]
8883 pub paypal: Option<miniserde::json::Value>,
8884 #[serde(skip_serializing_if = "Option::is_none")]
8886 #[serde(with = "stripe_types::with_serde_json_opt")]
8887 pub pix: Option<miniserde::json::Value>,
8888 #[serde(skip_serializing_if = "Option::is_none")]
8890 #[serde(with = "stripe_types::with_serde_json_opt")]
8891 pub promptpay: Option<miniserde::json::Value>,
8892 #[serde(skip_serializing_if = "Option::is_none")]
8895 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
8896 #[serde(skip_serializing_if = "Option::is_none")]
8898 #[serde(with = "stripe_types::with_serde_json_opt")]
8899 pub revolut_pay: Option<miniserde::json::Value>,
8900 #[serde(skip_serializing_if = "Option::is_none")]
8902 #[serde(with = "stripe_types::with_serde_json_opt")]
8903 pub samsung_pay: Option<miniserde::json::Value>,
8904 #[serde(skip_serializing_if = "Option::is_none")]
8906 #[serde(with = "stripe_types::with_serde_json_opt")]
8907 pub satispay: Option<miniserde::json::Value>,
8908 #[serde(skip_serializing_if = "Option::is_none")]
8910 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
8911 #[serde(skip_serializing_if = "Option::is_none")]
8913 pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
8914 #[serde(skip_serializing_if = "Option::is_none")]
8916 #[serde(with = "stripe_types::with_serde_json_opt")]
8917 pub swish: Option<miniserde::json::Value>,
8918 #[serde(skip_serializing_if = "Option::is_none")]
8920 #[serde(with = "stripe_types::with_serde_json_opt")]
8921 pub twint: Option<miniserde::json::Value>,
8922 #[serde(rename = "type")]
8926 pub type_: ConfirmSetupIntentPaymentMethodDataType,
8927 #[serde(skip_serializing_if = "Option::is_none")]
8929 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
8930 #[serde(skip_serializing_if = "Option::is_none")]
8932 #[serde(with = "stripe_types::with_serde_json_opt")]
8933 pub wechat_pay: Option<miniserde::json::Value>,
8934 #[serde(skip_serializing_if = "Option::is_none")]
8936 #[serde(with = "stripe_types::with_serde_json_opt")]
8937 pub zip: Option<miniserde::json::Value>,
8938}
8939impl ConfirmSetupIntentPaymentMethodData {
8940 pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
8941 Self {
8942 acss_debit: None,
8943 affirm: None,
8944 afterpay_clearpay: None,
8945 alipay: None,
8946 allow_redisplay: None,
8947 alma: None,
8948 amazon_pay: None,
8949 au_becs_debit: None,
8950 bacs_debit: None,
8951 bancontact: None,
8952 billie: None,
8953 billing_details: None,
8954 blik: None,
8955 boleto: None,
8956 cashapp: None,
8957 crypto: None,
8958 customer_balance: None,
8959 eps: None,
8960 fpx: None,
8961 giropay: None,
8962 grabpay: None,
8963 ideal: None,
8964 interac_present: None,
8965 kakao_pay: None,
8966 klarna: None,
8967 konbini: None,
8968 kr_card: None,
8969 link: None,
8970 mb_way: None,
8971 metadata: None,
8972 mobilepay: None,
8973 multibanco: None,
8974 naver_pay: None,
8975 nz_bank_account: None,
8976 oxxo: None,
8977 p24: None,
8978 pay_by_bank: None,
8979 payco: None,
8980 paynow: None,
8981 paypal: None,
8982 pix: None,
8983 promptpay: None,
8984 radar_options: None,
8985 revolut_pay: None,
8986 samsung_pay: None,
8987 satispay: None,
8988 sepa_debit: None,
8989 sofort: None,
8990 swish: None,
8991 twint: None,
8992 type_: type_.into(),
8993 us_bank_account: None,
8994 wechat_pay: None,
8995 zip: None,
8996 }
8997 }
8998}
8999#[derive(Copy, Clone, Eq, PartialEq)]
9003pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9004 Always,
9005 Limited,
9006 Unspecified,
9007}
9008impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9009 pub fn as_str(self) -> &'static str {
9010 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9011 match self {
9012 Always => "always",
9013 Limited => "limited",
9014 Unspecified => "unspecified",
9015 }
9016 }
9017}
9018
9019impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9020 type Err = stripe_types::StripeParseError;
9021 fn from_str(s: &str) -> Result<Self, Self::Err> {
9022 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9023 match s {
9024 "always" => Ok(Always),
9025 "limited" => Ok(Limited),
9026 "unspecified" => Ok(Unspecified),
9027 _ => Err(stripe_types::StripeParseError),
9028 }
9029 }
9030}
9031impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9032 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9033 f.write_str(self.as_str())
9034 }
9035}
9036
9037impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9038 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9039 f.write_str(self.as_str())
9040 }
9041}
9042impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9043 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9044 where
9045 S: serde::Serializer,
9046 {
9047 serializer.serialize_str(self.as_str())
9048 }
9049}
9050#[cfg(feature = "deserialize")]
9051impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9052 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9053 use std::str::FromStr;
9054 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9055 Self::from_str(&s).map_err(|_| {
9056 serde::de::Error::custom(
9057 "Unknown value for ConfirmSetupIntentPaymentMethodDataAllowRedisplay",
9058 )
9059 })
9060 }
9061}
9062#[derive(Clone, Debug, serde::Serialize)]
9064pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9065 pub account_number: String,
9067 pub bsb_number: String,
9069}
9070impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9071 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
9072 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
9073 }
9074}
9075#[derive(Clone, Debug, serde::Serialize)]
9077pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
9078 #[serde(skip_serializing_if = "Option::is_none")]
9080 pub account_number: Option<String>,
9081 #[serde(skip_serializing_if = "Option::is_none")]
9083 pub sort_code: Option<String>,
9084}
9085impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
9086 pub fn new() -> Self {
9087 Self { account_number: None, sort_code: None }
9088 }
9089}
9090impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
9091 fn default() -> Self {
9092 Self::new()
9093 }
9094}
9095#[derive(Clone, Debug, serde::Serialize)]
9097pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
9098 pub tax_id: String,
9100}
9101impl ConfirmSetupIntentPaymentMethodDataBoleto {
9102 pub fn new(tax_id: impl Into<String>) -> Self {
9103 Self { tax_id: tax_id.into() }
9104 }
9105}
9106#[derive(Clone, Debug, serde::Serialize)]
9108pub struct ConfirmSetupIntentPaymentMethodDataEps {
9109 #[serde(skip_serializing_if = "Option::is_none")]
9111 pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
9112}
9113impl ConfirmSetupIntentPaymentMethodDataEps {
9114 pub fn new() -> Self {
9115 Self { bank: None }
9116 }
9117}
9118impl Default for ConfirmSetupIntentPaymentMethodDataEps {
9119 fn default() -> Self {
9120 Self::new()
9121 }
9122}
9123#[derive(Clone, Eq, PartialEq)]
9125#[non_exhaustive]
9126pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
9127 ArzteUndApothekerBank,
9128 AustrianAnadiBankAg,
9129 BankAustria,
9130 BankhausCarlSpangler,
9131 BankhausSchelhammerUndSchatteraAg,
9132 BawagPskAg,
9133 BksBankAg,
9134 BrullKallmusBankAg,
9135 BtvVierLanderBank,
9136 CapitalBankGraweGruppeAg,
9137 DeutscheBankAg,
9138 Dolomitenbank,
9139 EasybankAg,
9140 ErsteBankUndSparkassen,
9141 HypoAlpeadriabankInternationalAg,
9142 HypoBankBurgenlandAktiengesellschaft,
9143 HypoNoeLbFurNiederosterreichUWien,
9144 HypoOberosterreichSalzburgSteiermark,
9145 HypoTirolBankAg,
9146 HypoVorarlbergBankAg,
9147 MarchfelderBank,
9148 OberbankAg,
9149 RaiffeisenBankengruppeOsterreich,
9150 SchoellerbankAg,
9151 SpardaBankWien,
9152 VolksbankGruppe,
9153 VolkskreditbankAg,
9154 VrBankBraunau,
9155 Unknown(String),
9157}
9158impl ConfirmSetupIntentPaymentMethodDataEpsBank {
9159 pub fn as_str(&self) -> &str {
9160 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9161 match self {
9162 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
9163 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
9164 BankAustria => "bank_austria",
9165 BankhausCarlSpangler => "bankhaus_carl_spangler",
9166 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
9167 BawagPskAg => "bawag_psk_ag",
9168 BksBankAg => "bks_bank_ag",
9169 BrullKallmusBankAg => "brull_kallmus_bank_ag",
9170 BtvVierLanderBank => "btv_vier_lander_bank",
9171 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
9172 DeutscheBankAg => "deutsche_bank_ag",
9173 Dolomitenbank => "dolomitenbank",
9174 EasybankAg => "easybank_ag",
9175 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
9176 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
9177 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
9178 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
9179 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
9180 HypoTirolBankAg => "hypo_tirol_bank_ag",
9181 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
9182 MarchfelderBank => "marchfelder_bank",
9183 OberbankAg => "oberbank_ag",
9184 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
9185 SchoellerbankAg => "schoellerbank_ag",
9186 SpardaBankWien => "sparda_bank_wien",
9187 VolksbankGruppe => "volksbank_gruppe",
9188 VolkskreditbankAg => "volkskreditbank_ag",
9189 VrBankBraunau => "vr_bank_braunau",
9190 Unknown(v) => v,
9191 }
9192 }
9193}
9194
9195impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
9196 type Err = std::convert::Infallible;
9197 fn from_str(s: &str) -> Result<Self, Self::Err> {
9198 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9199 match s {
9200 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
9201 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
9202 "bank_austria" => Ok(BankAustria),
9203 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
9204 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
9205 "bawag_psk_ag" => Ok(BawagPskAg),
9206 "bks_bank_ag" => Ok(BksBankAg),
9207 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
9208 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
9209 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
9210 "deutsche_bank_ag" => Ok(DeutscheBankAg),
9211 "dolomitenbank" => Ok(Dolomitenbank),
9212 "easybank_ag" => Ok(EasybankAg),
9213 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
9214 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
9215 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
9216 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
9217 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
9218 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
9219 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
9220 "marchfelder_bank" => Ok(MarchfelderBank),
9221 "oberbank_ag" => Ok(OberbankAg),
9222 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
9223 "schoellerbank_ag" => Ok(SchoellerbankAg),
9224 "sparda_bank_wien" => Ok(SpardaBankWien),
9225 "volksbank_gruppe" => Ok(VolksbankGruppe),
9226 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
9227 "vr_bank_braunau" => Ok(VrBankBraunau),
9228 v => Ok(Unknown(v.to_owned())),
9229 }
9230 }
9231}
9232impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
9233 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9234 f.write_str(self.as_str())
9235 }
9236}
9237
9238impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
9239 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9240 f.write_str(self.as_str())
9241 }
9242}
9243impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
9244 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9245 where
9246 S: serde::Serializer,
9247 {
9248 serializer.serialize_str(self.as_str())
9249 }
9250}
9251#[cfg(feature = "deserialize")]
9252impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
9253 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9254 use std::str::FromStr;
9255 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9256 Ok(Self::from_str(&s).unwrap())
9257 }
9258}
9259#[derive(Clone, Debug, serde::Serialize)]
9261pub struct ConfirmSetupIntentPaymentMethodDataFpx {
9262 #[serde(skip_serializing_if = "Option::is_none")]
9264 pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
9265 pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
9267}
9268impl ConfirmSetupIntentPaymentMethodDataFpx {
9269 pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
9270 Self { account_holder_type: None, bank: bank.into() }
9271 }
9272}
9273#[derive(Copy, Clone, Eq, PartialEq)]
9275pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9276 Company,
9277 Individual,
9278}
9279impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9280 pub fn as_str(self) -> &'static str {
9281 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9282 match self {
9283 Company => "company",
9284 Individual => "individual",
9285 }
9286 }
9287}
9288
9289impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9290 type Err = stripe_types::StripeParseError;
9291 fn from_str(s: &str) -> Result<Self, Self::Err> {
9292 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9293 match s {
9294 "company" => Ok(Company),
9295 "individual" => Ok(Individual),
9296 _ => Err(stripe_types::StripeParseError),
9297 }
9298 }
9299}
9300impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9301 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9302 f.write_str(self.as_str())
9303 }
9304}
9305
9306impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9307 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9308 f.write_str(self.as_str())
9309 }
9310}
9311impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9312 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9313 where
9314 S: serde::Serializer,
9315 {
9316 serializer.serialize_str(self.as_str())
9317 }
9318}
9319#[cfg(feature = "deserialize")]
9320impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9321 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9322 use std::str::FromStr;
9323 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9324 Self::from_str(&s).map_err(|_| {
9325 serde::de::Error::custom(
9326 "Unknown value for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType",
9327 )
9328 })
9329 }
9330}
9331#[derive(Clone, Eq, PartialEq)]
9333#[non_exhaustive]
9334pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
9335 AffinBank,
9336 Agrobank,
9337 AllianceBank,
9338 Ambank,
9339 BankIslam,
9340 BankMuamalat,
9341 BankOfChina,
9342 BankRakyat,
9343 Bsn,
9344 Cimb,
9345 DeutscheBank,
9346 HongLeongBank,
9347 Hsbc,
9348 Kfh,
9349 Maybank2e,
9350 Maybank2u,
9351 Ocbc,
9352 PbEnterprise,
9353 PublicBank,
9354 Rhb,
9355 StandardChartered,
9356 Uob,
9357 Unknown(String),
9359}
9360impl ConfirmSetupIntentPaymentMethodDataFpxBank {
9361 pub fn as_str(&self) -> &str {
9362 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9363 match self {
9364 AffinBank => "affin_bank",
9365 Agrobank => "agrobank",
9366 AllianceBank => "alliance_bank",
9367 Ambank => "ambank",
9368 BankIslam => "bank_islam",
9369 BankMuamalat => "bank_muamalat",
9370 BankOfChina => "bank_of_china",
9371 BankRakyat => "bank_rakyat",
9372 Bsn => "bsn",
9373 Cimb => "cimb",
9374 DeutscheBank => "deutsche_bank",
9375 HongLeongBank => "hong_leong_bank",
9376 Hsbc => "hsbc",
9377 Kfh => "kfh",
9378 Maybank2e => "maybank2e",
9379 Maybank2u => "maybank2u",
9380 Ocbc => "ocbc",
9381 PbEnterprise => "pb_enterprise",
9382 PublicBank => "public_bank",
9383 Rhb => "rhb",
9384 StandardChartered => "standard_chartered",
9385 Uob => "uob",
9386 Unknown(v) => v,
9387 }
9388 }
9389}
9390
9391impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
9392 type Err = std::convert::Infallible;
9393 fn from_str(s: &str) -> Result<Self, Self::Err> {
9394 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9395 match s {
9396 "affin_bank" => Ok(AffinBank),
9397 "agrobank" => Ok(Agrobank),
9398 "alliance_bank" => Ok(AllianceBank),
9399 "ambank" => Ok(Ambank),
9400 "bank_islam" => Ok(BankIslam),
9401 "bank_muamalat" => Ok(BankMuamalat),
9402 "bank_of_china" => Ok(BankOfChina),
9403 "bank_rakyat" => Ok(BankRakyat),
9404 "bsn" => Ok(Bsn),
9405 "cimb" => Ok(Cimb),
9406 "deutsche_bank" => Ok(DeutscheBank),
9407 "hong_leong_bank" => Ok(HongLeongBank),
9408 "hsbc" => Ok(Hsbc),
9409 "kfh" => Ok(Kfh),
9410 "maybank2e" => Ok(Maybank2e),
9411 "maybank2u" => Ok(Maybank2u),
9412 "ocbc" => Ok(Ocbc),
9413 "pb_enterprise" => Ok(PbEnterprise),
9414 "public_bank" => Ok(PublicBank),
9415 "rhb" => Ok(Rhb),
9416 "standard_chartered" => Ok(StandardChartered),
9417 "uob" => Ok(Uob),
9418 v => Ok(Unknown(v.to_owned())),
9419 }
9420 }
9421}
9422impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
9423 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9424 f.write_str(self.as_str())
9425 }
9426}
9427
9428impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
9429 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9430 f.write_str(self.as_str())
9431 }
9432}
9433impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
9434 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9435 where
9436 S: serde::Serializer,
9437 {
9438 serializer.serialize_str(self.as_str())
9439 }
9440}
9441#[cfg(feature = "deserialize")]
9442impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
9443 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9444 use std::str::FromStr;
9445 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9446 Ok(Self::from_str(&s).unwrap())
9447 }
9448}
9449#[derive(Clone, Debug, serde::Serialize)]
9451pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
9452 #[serde(skip_serializing_if = "Option::is_none")]
9456 pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
9457}
9458impl ConfirmSetupIntentPaymentMethodDataIdeal {
9459 pub fn new() -> Self {
9460 Self { bank: None }
9461 }
9462}
9463impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
9464 fn default() -> Self {
9465 Self::new()
9466 }
9467}
9468#[derive(Clone, Eq, PartialEq)]
9472#[non_exhaustive]
9473pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
9474 AbnAmro,
9475 AsnBank,
9476 Bunq,
9477 Buut,
9478 Handelsbanken,
9479 Ing,
9480 Knab,
9481 Moneyou,
9482 N26,
9483 Nn,
9484 Rabobank,
9485 Regiobank,
9486 Revolut,
9487 SnsBank,
9488 TriodosBank,
9489 VanLanschot,
9490 Yoursafe,
9491 Unknown(String),
9493}
9494impl ConfirmSetupIntentPaymentMethodDataIdealBank {
9495 pub fn as_str(&self) -> &str {
9496 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9497 match self {
9498 AbnAmro => "abn_amro",
9499 AsnBank => "asn_bank",
9500 Bunq => "bunq",
9501 Buut => "buut",
9502 Handelsbanken => "handelsbanken",
9503 Ing => "ing",
9504 Knab => "knab",
9505 Moneyou => "moneyou",
9506 N26 => "n26",
9507 Nn => "nn",
9508 Rabobank => "rabobank",
9509 Regiobank => "regiobank",
9510 Revolut => "revolut",
9511 SnsBank => "sns_bank",
9512 TriodosBank => "triodos_bank",
9513 VanLanschot => "van_lanschot",
9514 Yoursafe => "yoursafe",
9515 Unknown(v) => v,
9516 }
9517 }
9518}
9519
9520impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
9521 type Err = std::convert::Infallible;
9522 fn from_str(s: &str) -> Result<Self, Self::Err> {
9523 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9524 match s {
9525 "abn_amro" => Ok(AbnAmro),
9526 "asn_bank" => Ok(AsnBank),
9527 "bunq" => Ok(Bunq),
9528 "buut" => Ok(Buut),
9529 "handelsbanken" => Ok(Handelsbanken),
9530 "ing" => Ok(Ing),
9531 "knab" => Ok(Knab),
9532 "moneyou" => Ok(Moneyou),
9533 "n26" => Ok(N26),
9534 "nn" => Ok(Nn),
9535 "rabobank" => Ok(Rabobank),
9536 "regiobank" => Ok(Regiobank),
9537 "revolut" => Ok(Revolut),
9538 "sns_bank" => Ok(SnsBank),
9539 "triodos_bank" => Ok(TriodosBank),
9540 "van_lanschot" => Ok(VanLanschot),
9541 "yoursafe" => Ok(Yoursafe),
9542 v => Ok(Unknown(v.to_owned())),
9543 }
9544 }
9545}
9546impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
9547 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9548 f.write_str(self.as_str())
9549 }
9550}
9551
9552impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
9553 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9554 f.write_str(self.as_str())
9555 }
9556}
9557impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
9558 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9559 where
9560 S: serde::Serializer,
9561 {
9562 serializer.serialize_str(self.as_str())
9563 }
9564}
9565#[cfg(feature = "deserialize")]
9566impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
9567 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9568 use std::str::FromStr;
9569 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9570 Ok(Self::from_str(&s).unwrap())
9571 }
9572}
9573#[derive(Copy, Clone, Debug, serde::Serialize)]
9575pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
9576 #[serde(skip_serializing_if = "Option::is_none")]
9578 pub dob: Option<DateOfBirth>,
9579}
9580impl ConfirmSetupIntentPaymentMethodDataKlarna {
9581 pub fn new() -> Self {
9582 Self { dob: None }
9583 }
9584}
9585impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
9586 fn default() -> Self {
9587 Self::new()
9588 }
9589}
9590#[derive(Copy, Clone, Debug, serde::Serialize)]
9592pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
9593 #[serde(skip_serializing_if = "Option::is_none")]
9596 pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
9597}
9598impl ConfirmSetupIntentPaymentMethodDataNaverPay {
9599 pub fn new() -> Self {
9600 Self { funding: None }
9601 }
9602}
9603impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
9604 fn default() -> Self {
9605 Self::new()
9606 }
9607}
9608#[derive(Copy, Clone, Eq, PartialEq)]
9611pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9612 Card,
9613 Points,
9614}
9615impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9616 pub fn as_str(self) -> &'static str {
9617 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9618 match self {
9619 Card => "card",
9620 Points => "points",
9621 }
9622 }
9623}
9624
9625impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9626 type Err = stripe_types::StripeParseError;
9627 fn from_str(s: &str) -> Result<Self, Self::Err> {
9628 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9629 match s {
9630 "card" => Ok(Card),
9631 "points" => Ok(Points),
9632 _ => Err(stripe_types::StripeParseError),
9633 }
9634 }
9635}
9636impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9637 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9638 f.write_str(self.as_str())
9639 }
9640}
9641
9642impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9643 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9644 f.write_str(self.as_str())
9645 }
9646}
9647impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9648 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9649 where
9650 S: serde::Serializer,
9651 {
9652 serializer.serialize_str(self.as_str())
9653 }
9654}
9655#[cfg(feature = "deserialize")]
9656impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9657 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9658 use std::str::FromStr;
9659 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9660 Self::from_str(&s).map_err(|_| {
9661 serde::de::Error::custom(
9662 "Unknown value for ConfirmSetupIntentPaymentMethodDataNaverPayFunding",
9663 )
9664 })
9665 }
9666}
9667#[derive(Clone, Debug, serde::Serialize)]
9669pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9670 #[serde(skip_serializing_if = "Option::is_none")]
9673 pub account_holder_name: Option<String>,
9674 pub account_number: String,
9676 pub bank_code: String,
9678 pub branch_code: String,
9680 #[serde(skip_serializing_if = "Option::is_none")]
9681 pub reference: Option<String>,
9682 pub suffix: String,
9684}
9685impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9686 pub fn new(
9687 account_number: impl Into<String>,
9688 bank_code: impl Into<String>,
9689 branch_code: impl Into<String>,
9690 suffix: impl Into<String>,
9691 ) -> Self {
9692 Self {
9693 account_holder_name: None,
9694 account_number: account_number.into(),
9695 bank_code: bank_code.into(),
9696 branch_code: branch_code.into(),
9697 reference: None,
9698 suffix: suffix.into(),
9699 }
9700 }
9701}
9702#[derive(Clone, Debug, serde::Serialize)]
9704pub struct ConfirmSetupIntentPaymentMethodDataP24 {
9705 #[serde(skip_serializing_if = "Option::is_none")]
9707 pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
9708}
9709impl ConfirmSetupIntentPaymentMethodDataP24 {
9710 pub fn new() -> Self {
9711 Self { bank: None }
9712 }
9713}
9714impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
9715 fn default() -> Self {
9716 Self::new()
9717 }
9718}
9719#[derive(Clone, Eq, PartialEq)]
9721#[non_exhaustive]
9722pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
9723 AliorBank,
9724 BankMillennium,
9725 BankNowyBfgSa,
9726 BankPekaoSa,
9727 BankiSpbdzielcze,
9728 Blik,
9729 BnpParibas,
9730 Boz,
9731 CitiHandlowy,
9732 CreditAgricole,
9733 Envelobank,
9734 EtransferPocztowy24,
9735 GetinBank,
9736 Ideabank,
9737 Ing,
9738 Inteligo,
9739 MbankMtransfer,
9740 NestPrzelew,
9741 NoblePay,
9742 PbacZIpko,
9743 PlusBank,
9744 SantanderPrzelew24,
9745 TmobileUsbugiBankowe,
9746 ToyotaBank,
9747 Velobank,
9748 VolkswagenBank,
9749 Unknown(String),
9751}
9752impl ConfirmSetupIntentPaymentMethodDataP24Bank {
9753 pub fn as_str(&self) -> &str {
9754 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9755 match self {
9756 AliorBank => "alior_bank",
9757 BankMillennium => "bank_millennium",
9758 BankNowyBfgSa => "bank_nowy_bfg_sa",
9759 BankPekaoSa => "bank_pekao_sa",
9760 BankiSpbdzielcze => "banki_spbdzielcze",
9761 Blik => "blik",
9762 BnpParibas => "bnp_paribas",
9763 Boz => "boz",
9764 CitiHandlowy => "citi_handlowy",
9765 CreditAgricole => "credit_agricole",
9766 Envelobank => "envelobank",
9767 EtransferPocztowy24 => "etransfer_pocztowy24",
9768 GetinBank => "getin_bank",
9769 Ideabank => "ideabank",
9770 Ing => "ing",
9771 Inteligo => "inteligo",
9772 MbankMtransfer => "mbank_mtransfer",
9773 NestPrzelew => "nest_przelew",
9774 NoblePay => "noble_pay",
9775 PbacZIpko => "pbac_z_ipko",
9776 PlusBank => "plus_bank",
9777 SantanderPrzelew24 => "santander_przelew24",
9778 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
9779 ToyotaBank => "toyota_bank",
9780 Velobank => "velobank",
9781 VolkswagenBank => "volkswagen_bank",
9782 Unknown(v) => v,
9783 }
9784 }
9785}
9786
9787impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
9788 type Err = std::convert::Infallible;
9789 fn from_str(s: &str) -> Result<Self, Self::Err> {
9790 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9791 match s {
9792 "alior_bank" => Ok(AliorBank),
9793 "bank_millennium" => Ok(BankMillennium),
9794 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
9795 "bank_pekao_sa" => Ok(BankPekaoSa),
9796 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
9797 "blik" => Ok(Blik),
9798 "bnp_paribas" => Ok(BnpParibas),
9799 "boz" => Ok(Boz),
9800 "citi_handlowy" => Ok(CitiHandlowy),
9801 "credit_agricole" => Ok(CreditAgricole),
9802 "envelobank" => Ok(Envelobank),
9803 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
9804 "getin_bank" => Ok(GetinBank),
9805 "ideabank" => Ok(Ideabank),
9806 "ing" => Ok(Ing),
9807 "inteligo" => Ok(Inteligo),
9808 "mbank_mtransfer" => Ok(MbankMtransfer),
9809 "nest_przelew" => Ok(NestPrzelew),
9810 "noble_pay" => Ok(NoblePay),
9811 "pbac_z_ipko" => Ok(PbacZIpko),
9812 "plus_bank" => Ok(PlusBank),
9813 "santander_przelew24" => Ok(SantanderPrzelew24),
9814 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
9815 "toyota_bank" => Ok(ToyotaBank),
9816 "velobank" => Ok(Velobank),
9817 "volkswagen_bank" => Ok(VolkswagenBank),
9818 v => Ok(Unknown(v.to_owned())),
9819 }
9820 }
9821}
9822impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
9823 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9824 f.write_str(self.as_str())
9825 }
9826}
9827
9828impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
9829 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9830 f.write_str(self.as_str())
9831 }
9832}
9833impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
9834 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9835 where
9836 S: serde::Serializer,
9837 {
9838 serializer.serialize_str(self.as_str())
9839 }
9840}
9841#[cfg(feature = "deserialize")]
9842impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
9843 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9844 use std::str::FromStr;
9845 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9846 Ok(Self::from_str(&s).unwrap())
9847 }
9848}
9849#[derive(Clone, Debug, serde::Serialize)]
9851pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
9852 pub iban: String,
9854}
9855impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
9856 pub fn new(iban: impl Into<String>) -> Self {
9857 Self { iban: iban.into() }
9858 }
9859}
9860#[derive(Copy, Clone, Debug, serde::Serialize)]
9862pub struct ConfirmSetupIntentPaymentMethodDataSofort {
9863 pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
9865}
9866impl ConfirmSetupIntentPaymentMethodDataSofort {
9867 pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
9868 Self { country: country.into() }
9869 }
9870}
9871#[derive(Copy, Clone, Eq, PartialEq)]
9873pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
9874 At,
9875 Be,
9876 De,
9877 Es,
9878 It,
9879 Nl,
9880}
9881impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
9882 pub fn as_str(self) -> &'static str {
9883 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9884 match self {
9885 At => "AT",
9886 Be => "BE",
9887 De => "DE",
9888 Es => "ES",
9889 It => "IT",
9890 Nl => "NL",
9891 }
9892 }
9893}
9894
9895impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9896 type Err = stripe_types::StripeParseError;
9897 fn from_str(s: &str) -> Result<Self, Self::Err> {
9898 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9899 match s {
9900 "AT" => Ok(At),
9901 "BE" => Ok(Be),
9902 "DE" => Ok(De),
9903 "ES" => Ok(Es),
9904 "IT" => Ok(It),
9905 "NL" => Ok(Nl),
9906 _ => Err(stripe_types::StripeParseError),
9907 }
9908 }
9909}
9910impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9911 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9912 f.write_str(self.as_str())
9913 }
9914}
9915
9916impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9917 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9918 f.write_str(self.as_str())
9919 }
9920}
9921impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9922 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9923 where
9924 S: serde::Serializer,
9925 {
9926 serializer.serialize_str(self.as_str())
9927 }
9928}
9929#[cfg(feature = "deserialize")]
9930impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9931 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9932 use std::str::FromStr;
9933 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9934 Self::from_str(&s).map_err(|_| {
9935 serde::de::Error::custom(
9936 "Unknown value for ConfirmSetupIntentPaymentMethodDataSofortCountry",
9937 )
9938 })
9939 }
9940}
9941#[derive(Clone, Eq, PartialEq)]
9945#[non_exhaustive]
9946pub enum ConfirmSetupIntentPaymentMethodDataType {
9947 AcssDebit,
9948 Affirm,
9949 AfterpayClearpay,
9950 Alipay,
9951 Alma,
9952 AmazonPay,
9953 AuBecsDebit,
9954 BacsDebit,
9955 Bancontact,
9956 Billie,
9957 Blik,
9958 Boleto,
9959 Cashapp,
9960 Crypto,
9961 CustomerBalance,
9962 Eps,
9963 Fpx,
9964 Giropay,
9965 Grabpay,
9966 Ideal,
9967 KakaoPay,
9968 Klarna,
9969 Konbini,
9970 KrCard,
9971 Link,
9972 MbWay,
9973 Mobilepay,
9974 Multibanco,
9975 NaverPay,
9976 NzBankAccount,
9977 Oxxo,
9978 P24,
9979 PayByBank,
9980 Payco,
9981 Paynow,
9982 Paypal,
9983 Pix,
9984 Promptpay,
9985 RevolutPay,
9986 SamsungPay,
9987 Satispay,
9988 SepaDebit,
9989 Sofort,
9990 Swish,
9991 Twint,
9992 UsBankAccount,
9993 WechatPay,
9994 Zip,
9995 Unknown(String),
9997}
9998impl ConfirmSetupIntentPaymentMethodDataType {
9999 pub fn as_str(&self) -> &str {
10000 use ConfirmSetupIntentPaymentMethodDataType::*;
10001 match self {
10002 AcssDebit => "acss_debit",
10003 Affirm => "affirm",
10004 AfterpayClearpay => "afterpay_clearpay",
10005 Alipay => "alipay",
10006 Alma => "alma",
10007 AmazonPay => "amazon_pay",
10008 AuBecsDebit => "au_becs_debit",
10009 BacsDebit => "bacs_debit",
10010 Bancontact => "bancontact",
10011 Billie => "billie",
10012 Blik => "blik",
10013 Boleto => "boleto",
10014 Cashapp => "cashapp",
10015 Crypto => "crypto",
10016 CustomerBalance => "customer_balance",
10017 Eps => "eps",
10018 Fpx => "fpx",
10019 Giropay => "giropay",
10020 Grabpay => "grabpay",
10021 Ideal => "ideal",
10022 KakaoPay => "kakao_pay",
10023 Klarna => "klarna",
10024 Konbini => "konbini",
10025 KrCard => "kr_card",
10026 Link => "link",
10027 MbWay => "mb_way",
10028 Mobilepay => "mobilepay",
10029 Multibanco => "multibanco",
10030 NaverPay => "naver_pay",
10031 NzBankAccount => "nz_bank_account",
10032 Oxxo => "oxxo",
10033 P24 => "p24",
10034 PayByBank => "pay_by_bank",
10035 Payco => "payco",
10036 Paynow => "paynow",
10037 Paypal => "paypal",
10038 Pix => "pix",
10039 Promptpay => "promptpay",
10040 RevolutPay => "revolut_pay",
10041 SamsungPay => "samsung_pay",
10042 Satispay => "satispay",
10043 SepaDebit => "sepa_debit",
10044 Sofort => "sofort",
10045 Swish => "swish",
10046 Twint => "twint",
10047 UsBankAccount => "us_bank_account",
10048 WechatPay => "wechat_pay",
10049 Zip => "zip",
10050 Unknown(v) => v,
10051 }
10052 }
10053}
10054
10055impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
10056 type Err = std::convert::Infallible;
10057 fn from_str(s: &str) -> Result<Self, Self::Err> {
10058 use ConfirmSetupIntentPaymentMethodDataType::*;
10059 match s {
10060 "acss_debit" => Ok(AcssDebit),
10061 "affirm" => Ok(Affirm),
10062 "afterpay_clearpay" => Ok(AfterpayClearpay),
10063 "alipay" => Ok(Alipay),
10064 "alma" => Ok(Alma),
10065 "amazon_pay" => Ok(AmazonPay),
10066 "au_becs_debit" => Ok(AuBecsDebit),
10067 "bacs_debit" => Ok(BacsDebit),
10068 "bancontact" => Ok(Bancontact),
10069 "billie" => Ok(Billie),
10070 "blik" => Ok(Blik),
10071 "boleto" => Ok(Boleto),
10072 "cashapp" => Ok(Cashapp),
10073 "crypto" => Ok(Crypto),
10074 "customer_balance" => Ok(CustomerBalance),
10075 "eps" => Ok(Eps),
10076 "fpx" => Ok(Fpx),
10077 "giropay" => Ok(Giropay),
10078 "grabpay" => Ok(Grabpay),
10079 "ideal" => Ok(Ideal),
10080 "kakao_pay" => Ok(KakaoPay),
10081 "klarna" => Ok(Klarna),
10082 "konbini" => Ok(Konbini),
10083 "kr_card" => Ok(KrCard),
10084 "link" => Ok(Link),
10085 "mb_way" => Ok(MbWay),
10086 "mobilepay" => Ok(Mobilepay),
10087 "multibanco" => Ok(Multibanco),
10088 "naver_pay" => Ok(NaverPay),
10089 "nz_bank_account" => Ok(NzBankAccount),
10090 "oxxo" => Ok(Oxxo),
10091 "p24" => Ok(P24),
10092 "pay_by_bank" => Ok(PayByBank),
10093 "payco" => Ok(Payco),
10094 "paynow" => Ok(Paynow),
10095 "paypal" => Ok(Paypal),
10096 "pix" => Ok(Pix),
10097 "promptpay" => Ok(Promptpay),
10098 "revolut_pay" => Ok(RevolutPay),
10099 "samsung_pay" => Ok(SamsungPay),
10100 "satispay" => Ok(Satispay),
10101 "sepa_debit" => Ok(SepaDebit),
10102 "sofort" => Ok(Sofort),
10103 "swish" => Ok(Swish),
10104 "twint" => Ok(Twint),
10105 "us_bank_account" => Ok(UsBankAccount),
10106 "wechat_pay" => Ok(WechatPay),
10107 "zip" => Ok(Zip),
10108 v => Ok(Unknown(v.to_owned())),
10109 }
10110 }
10111}
10112impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
10113 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10114 f.write_str(self.as_str())
10115 }
10116}
10117
10118impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
10119 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10120 f.write_str(self.as_str())
10121 }
10122}
10123impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
10124 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10125 where
10126 S: serde::Serializer,
10127 {
10128 serializer.serialize_str(self.as_str())
10129 }
10130}
10131#[cfg(feature = "deserialize")]
10132impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
10133 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10134 use std::str::FromStr;
10135 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10136 Ok(Self::from_str(&s).unwrap())
10137 }
10138}
10139#[derive(Clone, Debug, serde::Serialize)]
10141pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10142 #[serde(skip_serializing_if = "Option::is_none")]
10144 pub account_holder_type:
10145 Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
10146 #[serde(skip_serializing_if = "Option::is_none")]
10148 pub account_number: Option<String>,
10149 #[serde(skip_serializing_if = "Option::is_none")]
10151 pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
10152 #[serde(skip_serializing_if = "Option::is_none")]
10154 pub financial_connections_account: Option<String>,
10155 #[serde(skip_serializing_if = "Option::is_none")]
10157 pub routing_number: Option<String>,
10158}
10159impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10160 pub fn new() -> Self {
10161 Self {
10162 account_holder_type: None,
10163 account_number: None,
10164 account_type: None,
10165 financial_connections_account: None,
10166 routing_number: None,
10167 }
10168 }
10169}
10170impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10171 fn default() -> Self {
10172 Self::new()
10173 }
10174}
10175#[derive(Copy, Clone, Eq, PartialEq)]
10177pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10178 Company,
10179 Individual,
10180}
10181impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10182 pub fn as_str(self) -> &'static str {
10183 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10184 match self {
10185 Company => "company",
10186 Individual => "individual",
10187 }
10188 }
10189}
10190
10191impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10192 type Err = stripe_types::StripeParseError;
10193 fn from_str(s: &str) -> Result<Self, Self::Err> {
10194 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10195 match s {
10196 "company" => Ok(Company),
10197 "individual" => Ok(Individual),
10198 _ => Err(stripe_types::StripeParseError),
10199 }
10200 }
10201}
10202impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10203 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10204 f.write_str(self.as_str())
10205 }
10206}
10207
10208impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10209 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10210 f.write_str(self.as_str())
10211 }
10212}
10213impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10214 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10215 where
10216 S: serde::Serializer,
10217 {
10218 serializer.serialize_str(self.as_str())
10219 }
10220}
10221#[cfg(feature = "deserialize")]
10222impl<'de> serde::Deserialize<'de>
10223 for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
10224{
10225 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10226 use std::str::FromStr;
10227 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10228 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
10229 }
10230}
10231#[derive(Copy, Clone, Eq, PartialEq)]
10233pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10234 Checking,
10235 Savings,
10236}
10237impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10238 pub fn as_str(self) -> &'static str {
10239 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10240 match self {
10241 Checking => "checking",
10242 Savings => "savings",
10243 }
10244 }
10245}
10246
10247impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10248 type Err = stripe_types::StripeParseError;
10249 fn from_str(s: &str) -> Result<Self, Self::Err> {
10250 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10251 match s {
10252 "checking" => Ok(Checking),
10253 "savings" => Ok(Savings),
10254 _ => Err(stripe_types::StripeParseError),
10255 }
10256 }
10257}
10258impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10259 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10260 f.write_str(self.as_str())
10261 }
10262}
10263
10264impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10265 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10266 f.write_str(self.as_str())
10267 }
10268}
10269impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10270 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10271 where
10272 S: serde::Serializer,
10273 {
10274 serializer.serialize_str(self.as_str())
10275 }
10276}
10277#[cfg(feature = "deserialize")]
10278impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10279 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10280 use std::str::FromStr;
10281 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10282 Self::from_str(&s).map_err(|_| {
10283 serde::de::Error::custom(
10284 "Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType",
10285 )
10286 })
10287 }
10288}
10289#[derive(Clone, Debug, serde::Serialize)]
10291pub struct ConfirmSetupIntentPaymentMethodOptions {
10292 #[serde(skip_serializing_if = "Option::is_none")]
10294 pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
10295 #[serde(skip_serializing_if = "Option::is_none")]
10297 #[serde(with = "stripe_types::with_serde_json_opt")]
10298 pub amazon_pay: Option<miniserde::json::Value>,
10299 #[serde(skip_serializing_if = "Option::is_none")]
10301 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
10302 #[serde(skip_serializing_if = "Option::is_none")]
10304 pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
10305 #[serde(skip_serializing_if = "Option::is_none")]
10307 #[serde(with = "stripe_types::with_serde_json_opt")]
10308 pub card_present: Option<miniserde::json::Value>,
10309 #[serde(skip_serializing_if = "Option::is_none")]
10311 pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
10312 #[serde(skip_serializing_if = "Option::is_none")]
10314 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
10315 #[serde(skip_serializing_if = "Option::is_none")]
10317 pub paypal: Option<PaymentMethodOptionsParam>,
10318 #[serde(skip_serializing_if = "Option::is_none")]
10320 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
10321 #[serde(skip_serializing_if = "Option::is_none")]
10323 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
10324}
10325impl ConfirmSetupIntentPaymentMethodOptions {
10326 pub fn new() -> Self {
10327 Self {
10328 acss_debit: None,
10329 amazon_pay: None,
10330 bacs_debit: None,
10331 card: None,
10332 card_present: None,
10333 klarna: None,
10334 link: None,
10335 paypal: None,
10336 sepa_debit: None,
10337 us_bank_account: None,
10338 }
10339 }
10340}
10341impl Default for ConfirmSetupIntentPaymentMethodOptions {
10342 fn default() -> Self {
10343 Self::new()
10344 }
10345}
10346#[derive(Clone, Debug, serde::Serialize)]
10348pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10349 #[serde(skip_serializing_if = "Option::is_none")]
10352 pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
10353 #[serde(skip_serializing_if = "Option::is_none")]
10355 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
10356 #[serde(skip_serializing_if = "Option::is_none")]
10358 pub verification_method:
10359 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
10360}
10361impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10362 pub fn new() -> Self {
10363 Self { currency: None, mandate_options: None, verification_method: None }
10364 }
10365}
10366impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10367 fn default() -> Self {
10368 Self::new()
10369 }
10370}
10371#[derive(Copy, Clone, Eq, PartialEq)]
10374pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10375 Cad,
10376 Usd,
10377}
10378impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10379 pub fn as_str(self) -> &'static str {
10380 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10381 match self {
10382 Cad => "cad",
10383 Usd => "usd",
10384 }
10385 }
10386}
10387
10388impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10389 type Err = stripe_types::StripeParseError;
10390 fn from_str(s: &str) -> Result<Self, Self::Err> {
10391 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10392 match s {
10393 "cad" => Ok(Cad),
10394 "usd" => Ok(Usd),
10395 _ => Err(stripe_types::StripeParseError),
10396 }
10397 }
10398}
10399impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10400 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10401 f.write_str(self.as_str())
10402 }
10403}
10404
10405impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10406 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10407 f.write_str(self.as_str())
10408 }
10409}
10410impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10411 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10412 where
10413 S: serde::Serializer,
10414 {
10415 serializer.serialize_str(self.as_str())
10416 }
10417}
10418#[cfg(feature = "deserialize")]
10419impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10420 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10421 use std::str::FromStr;
10422 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10423 Self::from_str(&s).map_err(|_| {
10424 serde::de::Error::custom(
10425 "Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency",
10426 )
10427 })
10428 }
10429}
10430#[derive(Clone, Debug, serde::Serialize)]
10432pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10433 #[serde(skip_serializing_if = "Option::is_none")]
10437 pub custom_mandate_url: Option<String>,
10438 #[serde(skip_serializing_if = "Option::is_none")]
10440 pub default_for:
10441 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
10442 #[serde(skip_serializing_if = "Option::is_none")]
10445 pub interval_description: Option<String>,
10446 #[serde(skip_serializing_if = "Option::is_none")]
10448 pub payment_schedule:
10449 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
10450 #[serde(skip_serializing_if = "Option::is_none")]
10452 pub transaction_type:
10453 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
10454}
10455impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10456 pub fn new() -> Self {
10457 Self {
10458 custom_mandate_url: None,
10459 default_for: None,
10460 interval_description: None,
10461 payment_schedule: None,
10462 transaction_type: None,
10463 }
10464 }
10465}
10466impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10467 fn default() -> Self {
10468 Self::new()
10469 }
10470}
10471#[derive(Copy, Clone, Eq, PartialEq)]
10473pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10474 Invoice,
10475 Subscription,
10476}
10477impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10478 pub fn as_str(self) -> &'static str {
10479 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10480 match self {
10481 Invoice => "invoice",
10482 Subscription => "subscription",
10483 }
10484 }
10485}
10486
10487impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10488 type Err = stripe_types::StripeParseError;
10489 fn from_str(s: &str) -> Result<Self, Self::Err> {
10490 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10491 match s {
10492 "invoice" => Ok(Invoice),
10493 "subscription" => Ok(Subscription),
10494 _ => Err(stripe_types::StripeParseError),
10495 }
10496 }
10497}
10498impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10499 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10500 f.write_str(self.as_str())
10501 }
10502}
10503
10504impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10505 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10506 f.write_str(self.as_str())
10507 }
10508}
10509impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10510 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10511 where
10512 S: serde::Serializer,
10513 {
10514 serializer.serialize_str(self.as_str())
10515 }
10516}
10517#[cfg(feature = "deserialize")]
10518impl<'de> serde::Deserialize<'de>
10519 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
10520{
10521 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10522 use std::str::FromStr;
10523 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10524 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
10525 }
10526}
10527#[derive(Copy, Clone, Eq, PartialEq)]
10529pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10530 Combined,
10531 Interval,
10532 Sporadic,
10533}
10534impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10535 pub fn as_str(self) -> &'static str {
10536 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10537 match self {
10538 Combined => "combined",
10539 Interval => "interval",
10540 Sporadic => "sporadic",
10541 }
10542 }
10543}
10544
10545impl std::str::FromStr
10546 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10547{
10548 type Err = stripe_types::StripeParseError;
10549 fn from_str(s: &str) -> Result<Self, Self::Err> {
10550 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10551 match s {
10552 "combined" => Ok(Combined),
10553 "interval" => Ok(Interval),
10554 "sporadic" => Ok(Sporadic),
10555 _ => Err(stripe_types::StripeParseError),
10556 }
10557 }
10558}
10559impl std::fmt::Display
10560 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10561{
10562 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10563 f.write_str(self.as_str())
10564 }
10565}
10566
10567impl std::fmt::Debug
10568 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10569{
10570 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10571 f.write_str(self.as_str())
10572 }
10573}
10574impl serde::Serialize
10575 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10576{
10577 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10578 where
10579 S: serde::Serializer,
10580 {
10581 serializer.serialize_str(self.as_str())
10582 }
10583}
10584#[cfg(feature = "deserialize")]
10585impl<'de> serde::Deserialize<'de>
10586 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10587{
10588 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10589 use std::str::FromStr;
10590 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10591 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
10592 }
10593}
10594#[derive(Copy, Clone, Eq, PartialEq)]
10596pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10597 Business,
10598 Personal,
10599}
10600impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10601 pub fn as_str(self) -> &'static str {
10602 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10603 match self {
10604 Business => "business",
10605 Personal => "personal",
10606 }
10607 }
10608}
10609
10610impl std::str::FromStr
10611 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10612{
10613 type Err = stripe_types::StripeParseError;
10614 fn from_str(s: &str) -> Result<Self, Self::Err> {
10615 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10616 match s {
10617 "business" => Ok(Business),
10618 "personal" => Ok(Personal),
10619 _ => Err(stripe_types::StripeParseError),
10620 }
10621 }
10622}
10623impl std::fmt::Display
10624 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10625{
10626 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10627 f.write_str(self.as_str())
10628 }
10629}
10630
10631impl std::fmt::Debug
10632 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10633{
10634 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10635 f.write_str(self.as_str())
10636 }
10637}
10638impl serde::Serialize
10639 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10640{
10641 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10642 where
10643 S: serde::Serializer,
10644 {
10645 serializer.serialize_str(self.as_str())
10646 }
10647}
10648#[cfg(feature = "deserialize")]
10649impl<'de> serde::Deserialize<'de>
10650 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10651{
10652 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10653 use std::str::FromStr;
10654 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10655 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
10656 }
10657}
10658#[derive(Copy, Clone, Eq, PartialEq)]
10660pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10661 Automatic,
10662 Instant,
10663 Microdeposits,
10664}
10665impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10666 pub fn as_str(self) -> &'static str {
10667 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10668 match self {
10669 Automatic => "automatic",
10670 Instant => "instant",
10671 Microdeposits => "microdeposits",
10672 }
10673 }
10674}
10675
10676impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10677 type Err = stripe_types::StripeParseError;
10678 fn from_str(s: &str) -> Result<Self, Self::Err> {
10679 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10680 match s {
10681 "automatic" => Ok(Automatic),
10682 "instant" => Ok(Instant),
10683 "microdeposits" => Ok(Microdeposits),
10684 _ => Err(stripe_types::StripeParseError),
10685 }
10686 }
10687}
10688impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10689 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10690 f.write_str(self.as_str())
10691 }
10692}
10693
10694impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10695 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10696 f.write_str(self.as_str())
10697 }
10698}
10699impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10700 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10701 where
10702 S: serde::Serializer,
10703 {
10704 serializer.serialize_str(self.as_str())
10705 }
10706}
10707#[cfg(feature = "deserialize")]
10708impl<'de> serde::Deserialize<'de>
10709 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
10710{
10711 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10712 use std::str::FromStr;
10713 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10714 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
10715 }
10716}
10717#[derive(Clone, Debug, serde::Serialize)]
10719pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10720 #[serde(skip_serializing_if = "Option::is_none")]
10722 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
10723}
10724impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10725 pub fn new() -> Self {
10726 Self { mandate_options: None }
10727 }
10728}
10729impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10730 fn default() -> Self {
10731 Self::new()
10732 }
10733}
10734#[derive(Clone, Debug, serde::Serialize)]
10736pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
10737 #[serde(skip_serializing_if = "Option::is_none")]
10739 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
10740 #[serde(skip_serializing_if = "Option::is_none")]
10744 pub moto: Option<bool>,
10745 #[serde(skip_serializing_if = "Option::is_none")]
10749 pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
10750 #[serde(skip_serializing_if = "Option::is_none")]
10755 pub request_three_d_secure:
10756 Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
10757 #[serde(skip_serializing_if = "Option::is_none")]
10760 pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
10761}
10762impl ConfirmSetupIntentPaymentMethodOptionsCard {
10763 pub fn new() -> Self {
10764 Self {
10765 mandate_options: None,
10766 moto: None,
10767 network: None,
10768 request_three_d_secure: None,
10769 three_d_secure: None,
10770 }
10771 }
10772}
10773impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
10774 fn default() -> Self {
10775 Self::new()
10776 }
10777}
10778#[derive(Clone, Debug, serde::Serialize)]
10780pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10781 pub amount: i64,
10783 pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
10787 pub currency: stripe_types::Currency,
10791 #[serde(skip_serializing_if = "Option::is_none")]
10793 pub description: Option<String>,
10794 #[serde(skip_serializing_if = "Option::is_none")]
10798 pub end_date: Option<stripe_types::Timestamp>,
10799 pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
10801 #[serde(skip_serializing_if = "Option::is_none")]
10806 pub interval_count: Option<u64>,
10807 pub reference: String,
10809 pub start_date: stripe_types::Timestamp,
10811 #[serde(skip_serializing_if = "Option::is_none")]
10813 pub supported_types:
10814 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
10815}
10816impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10817 pub fn new(
10818 amount: impl Into<i64>,
10819 amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
10820 currency: impl Into<stripe_types::Currency>,
10821 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
10822 reference: impl Into<String>,
10823 start_date: impl Into<stripe_types::Timestamp>,
10824 ) -> Self {
10825 Self {
10826 amount: amount.into(),
10827 amount_type: amount_type.into(),
10828 currency: currency.into(),
10829 description: None,
10830 end_date: None,
10831 interval: interval.into(),
10832 interval_count: None,
10833 reference: reference.into(),
10834 start_date: start_date.into(),
10835 supported_types: None,
10836 }
10837 }
10838}
10839#[derive(Copy, Clone, Eq, PartialEq)]
10843pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10844 Fixed,
10845 Maximum,
10846}
10847impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10848 pub fn as_str(self) -> &'static str {
10849 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10850 match self {
10851 Fixed => "fixed",
10852 Maximum => "maximum",
10853 }
10854 }
10855}
10856
10857impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10858 type Err = stripe_types::StripeParseError;
10859 fn from_str(s: &str) -> Result<Self, Self::Err> {
10860 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10861 match s {
10862 "fixed" => Ok(Fixed),
10863 "maximum" => Ok(Maximum),
10864 _ => Err(stripe_types::StripeParseError),
10865 }
10866 }
10867}
10868impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10869 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10870 f.write_str(self.as_str())
10871 }
10872}
10873
10874impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10875 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10876 f.write_str(self.as_str())
10877 }
10878}
10879impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10880 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10881 where
10882 S: serde::Serializer,
10883 {
10884 serializer.serialize_str(self.as_str())
10885 }
10886}
10887#[cfg(feature = "deserialize")]
10888impl<'de> serde::Deserialize<'de>
10889 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
10890{
10891 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10892 use std::str::FromStr;
10893 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10894 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
10895 }
10896}
10897#[derive(Copy, Clone, Eq, PartialEq)]
10899pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10900 Day,
10901 Month,
10902 Sporadic,
10903 Week,
10904 Year,
10905}
10906impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10907 pub fn as_str(self) -> &'static str {
10908 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10909 match self {
10910 Day => "day",
10911 Month => "month",
10912 Sporadic => "sporadic",
10913 Week => "week",
10914 Year => "year",
10915 }
10916 }
10917}
10918
10919impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10920 type Err = stripe_types::StripeParseError;
10921 fn from_str(s: &str) -> Result<Self, Self::Err> {
10922 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10923 match s {
10924 "day" => Ok(Day),
10925 "month" => Ok(Month),
10926 "sporadic" => Ok(Sporadic),
10927 "week" => Ok(Week),
10928 "year" => Ok(Year),
10929 _ => Err(stripe_types::StripeParseError),
10930 }
10931 }
10932}
10933impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10934 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10935 f.write_str(self.as_str())
10936 }
10937}
10938
10939impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10940 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10941 f.write_str(self.as_str())
10942 }
10943}
10944impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10945 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10946 where
10947 S: serde::Serializer,
10948 {
10949 serializer.serialize_str(self.as_str())
10950 }
10951}
10952#[cfg(feature = "deserialize")]
10953impl<'de> serde::Deserialize<'de>
10954 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
10955{
10956 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10957 use std::str::FromStr;
10958 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10959 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"))
10960 }
10961}
10962#[derive(Copy, Clone, Eq, PartialEq)]
10964pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10965 India,
10966}
10967impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10968 pub fn as_str(self) -> &'static str {
10969 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
10970 match self {
10971 India => "india",
10972 }
10973 }
10974}
10975
10976impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10977 type Err = stripe_types::StripeParseError;
10978 fn from_str(s: &str) -> Result<Self, Self::Err> {
10979 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
10980 match s {
10981 "india" => Ok(India),
10982 _ => Err(stripe_types::StripeParseError),
10983 }
10984 }
10985}
10986impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10987 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10988 f.write_str(self.as_str())
10989 }
10990}
10991
10992impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10993 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10994 f.write_str(self.as_str())
10995 }
10996}
10997impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10998 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10999 where
11000 S: serde::Serializer,
11001 {
11002 serializer.serialize_str(self.as_str())
11003 }
11004}
11005#[cfg(feature = "deserialize")]
11006impl<'de> serde::Deserialize<'de>
11007 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
11008{
11009 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11010 use std::str::FromStr;
11011 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11012 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
11013 }
11014}
11015#[derive(Copy, Clone, Eq, PartialEq)]
11019pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11020 Amex,
11021 CartesBancaires,
11022 Diners,
11023 Discover,
11024 EftposAu,
11025 Girocard,
11026 Interac,
11027 Jcb,
11028 Link,
11029 Mastercard,
11030 Unionpay,
11031 Unknown,
11032 Visa,
11033}
11034impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11035 pub fn as_str(self) -> &'static str {
11036 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11037 match self {
11038 Amex => "amex",
11039 CartesBancaires => "cartes_bancaires",
11040 Diners => "diners",
11041 Discover => "discover",
11042 EftposAu => "eftpos_au",
11043 Girocard => "girocard",
11044 Interac => "interac",
11045 Jcb => "jcb",
11046 Link => "link",
11047 Mastercard => "mastercard",
11048 Unionpay => "unionpay",
11049 Unknown => "unknown",
11050 Visa => "visa",
11051 }
11052 }
11053}
11054
11055impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11056 type Err = stripe_types::StripeParseError;
11057 fn from_str(s: &str) -> Result<Self, Self::Err> {
11058 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11059 match s {
11060 "amex" => Ok(Amex),
11061 "cartes_bancaires" => Ok(CartesBancaires),
11062 "diners" => Ok(Diners),
11063 "discover" => Ok(Discover),
11064 "eftpos_au" => Ok(EftposAu),
11065 "girocard" => Ok(Girocard),
11066 "interac" => Ok(Interac),
11067 "jcb" => Ok(Jcb),
11068 "link" => Ok(Link),
11069 "mastercard" => Ok(Mastercard),
11070 "unionpay" => Ok(Unionpay),
11071 "unknown" => Ok(Unknown),
11072 "visa" => Ok(Visa),
11073 _ => Err(stripe_types::StripeParseError),
11074 }
11075 }
11076}
11077impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11078 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11079 f.write_str(self.as_str())
11080 }
11081}
11082
11083impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11084 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11085 f.write_str(self.as_str())
11086 }
11087}
11088impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11089 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11090 where
11091 S: serde::Serializer,
11092 {
11093 serializer.serialize_str(self.as_str())
11094 }
11095}
11096#[cfg(feature = "deserialize")]
11097impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11098 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11099 use std::str::FromStr;
11100 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11101 Self::from_str(&s).map_err(|_| {
11102 serde::de::Error::custom(
11103 "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardNetwork",
11104 )
11105 })
11106 }
11107}
11108#[derive(Copy, Clone, Eq, PartialEq)]
11113pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11114 Any,
11115 Automatic,
11116 Challenge,
11117}
11118impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11119 pub fn as_str(self) -> &'static str {
11120 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11121 match self {
11122 Any => "any",
11123 Automatic => "automatic",
11124 Challenge => "challenge",
11125 }
11126 }
11127}
11128
11129impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11130 type Err = stripe_types::StripeParseError;
11131 fn from_str(s: &str) -> Result<Self, Self::Err> {
11132 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11133 match s {
11134 "any" => Ok(Any),
11135 "automatic" => Ok(Automatic),
11136 "challenge" => Ok(Challenge),
11137 _ => Err(stripe_types::StripeParseError),
11138 }
11139 }
11140}
11141impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11142 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11143 f.write_str(self.as_str())
11144 }
11145}
11146
11147impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11148 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11149 f.write_str(self.as_str())
11150 }
11151}
11152impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11153 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11154 where
11155 S: serde::Serializer,
11156 {
11157 serializer.serialize_str(self.as_str())
11158 }
11159}
11160#[cfg(feature = "deserialize")]
11161impl<'de> serde::Deserialize<'de>
11162 for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
11163{
11164 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11165 use std::str::FromStr;
11166 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11167 Self::from_str(&s).map_err(|_| {
11168 serde::de::Error::custom(
11169 "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
11170 )
11171 })
11172 }
11173}
11174#[derive(Clone, Debug, serde::Serialize)]
11177pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11178 #[serde(skip_serializing_if = "Option::is_none")]
11180 pub ares_trans_status:
11181 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
11182 #[serde(skip_serializing_if = "Option::is_none")]
11187 pub cryptogram: Option<String>,
11188 #[serde(skip_serializing_if = "Option::is_none")]
11191 pub electronic_commerce_indicator:
11192 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
11193 #[serde(skip_serializing_if = "Option::is_none")]
11197 pub network_options:
11198 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
11199 #[serde(skip_serializing_if = "Option::is_none")]
11202 pub requestor_challenge_indicator: Option<String>,
11203 #[serde(skip_serializing_if = "Option::is_none")]
11206 pub transaction_id: Option<String>,
11207 #[serde(skip_serializing_if = "Option::is_none")]
11209 pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
11210}
11211impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11212 pub fn new() -> Self {
11213 Self {
11214 ares_trans_status: None,
11215 cryptogram: None,
11216 electronic_commerce_indicator: None,
11217 network_options: None,
11218 requestor_challenge_indicator: None,
11219 transaction_id: None,
11220 version: None,
11221 }
11222 }
11223}
11224impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11225 fn default() -> Self {
11226 Self::new()
11227 }
11228}
11229#[derive(Copy, Clone, Eq, PartialEq)]
11231pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11232 A,
11233 C,
11234 I,
11235 N,
11236 R,
11237 U,
11238 Y,
11239}
11240impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11241 pub fn as_str(self) -> &'static str {
11242 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11243 match self {
11244 A => "A",
11245 C => "C",
11246 I => "I",
11247 N => "N",
11248 R => "R",
11249 U => "U",
11250 Y => "Y",
11251 }
11252 }
11253}
11254
11255impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11256 type Err = stripe_types::StripeParseError;
11257 fn from_str(s: &str) -> Result<Self, Self::Err> {
11258 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11259 match s {
11260 "A" => Ok(A),
11261 "C" => Ok(C),
11262 "I" => Ok(I),
11263 "N" => Ok(N),
11264 "R" => Ok(R),
11265 "U" => Ok(U),
11266 "Y" => Ok(Y),
11267 _ => Err(stripe_types::StripeParseError),
11268 }
11269 }
11270}
11271impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11272 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11273 f.write_str(self.as_str())
11274 }
11275}
11276
11277impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11278 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11279 f.write_str(self.as_str())
11280 }
11281}
11282impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11283 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11284 where
11285 S: serde::Serializer,
11286 {
11287 serializer.serialize_str(self.as_str())
11288 }
11289}
11290#[cfg(feature = "deserialize")]
11291impl<'de> serde::Deserialize<'de>
11292 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
11293{
11294 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11295 use std::str::FromStr;
11296 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11297 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
11298 }
11299}
11300#[derive(Copy, Clone, Eq, PartialEq)]
11303pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11304 V01,
11305 V02,
11306 V05,
11307 V06,
11308 V07,
11309}
11310impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11311 pub fn as_str(self) -> &'static str {
11312 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11313 match self {
11314 V01 => "01",
11315 V02 => "02",
11316 V05 => "05",
11317 V06 => "06",
11318 V07 => "07",
11319 }
11320 }
11321}
11322
11323impl std::str::FromStr
11324 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11325{
11326 type Err = stripe_types::StripeParseError;
11327 fn from_str(s: &str) -> Result<Self, Self::Err> {
11328 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11329 match s {
11330 "01" => Ok(V01),
11331 "02" => Ok(V02),
11332 "05" => Ok(V05),
11333 "06" => Ok(V06),
11334 "07" => Ok(V07),
11335 _ => Err(stripe_types::StripeParseError),
11336 }
11337 }
11338}
11339impl std::fmt::Display
11340 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11341{
11342 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11343 f.write_str(self.as_str())
11344 }
11345}
11346
11347impl std::fmt::Debug
11348 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11349{
11350 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11351 f.write_str(self.as_str())
11352 }
11353}
11354impl serde::Serialize
11355 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11356{
11357 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11358 where
11359 S: serde::Serializer,
11360 {
11361 serializer.serialize_str(self.as_str())
11362 }
11363}
11364#[cfg(feature = "deserialize")]
11365impl<'de> serde::Deserialize<'de>
11366 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11367{
11368 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11369 use std::str::FromStr;
11370 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11371 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
11372 }
11373}
11374#[derive(Clone, Debug, serde::Serialize)]
11378pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11379 #[serde(skip_serializing_if = "Option::is_none")]
11381 pub cartes_bancaires:
11382 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
11383}
11384impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11385 pub fn new() -> Self {
11386 Self { cartes_bancaires: None }
11387 }
11388}
11389impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11390 fn default() -> Self {
11391 Self::new()
11392 }
11393}
11394#[derive(Clone, Debug, serde::Serialize)]
11396pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11397 pub cb_avalgo:
11401 ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
11402 #[serde(skip_serializing_if = "Option::is_none")]
11407 pub cb_exemption: Option<String>,
11408 #[serde(skip_serializing_if = "Option::is_none")]
11411 pub cb_score: Option<i64>,
11412}
11413impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11414 pub fn new(
11415 cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
11416 ) -> Self {
11417 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
11418 }
11419}
11420#[derive(Copy, Clone, Eq, PartialEq)]
11424pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11425{
11426 V0,
11427 V1,
11428 V2,
11429 V3,
11430 V4,
11431 A,
11432}
11433impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
11434 pub fn as_str(self) -> &'static str {
11435 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11436 match self {
11437 V0 => "0",
11438 V1 => "1",
11439 V2 => "2",
11440 V3 => "3",
11441 V4 => "4",
11442 A => "A",
11443 }
11444 }
11445}
11446
11447impl std::str::FromStr
11448 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11449{
11450 type Err = stripe_types::StripeParseError;
11451 fn from_str(s: &str) -> Result<Self, Self::Err> {
11452 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11453 match s {
11454 "0" => Ok(V0),
11455 "1" => Ok(V1),
11456 "2" => Ok(V2),
11457 "3" => Ok(V3),
11458 "4" => Ok(V4),
11459 "A" => Ok(A),
11460 _ => Err(stripe_types::StripeParseError),
11461 }
11462 }
11463}
11464impl std::fmt::Display
11465 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11466{
11467 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11468 f.write_str(self.as_str())
11469 }
11470}
11471
11472impl std::fmt::Debug
11473 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11474{
11475 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11476 f.write_str(self.as_str())
11477 }
11478}
11479impl serde::Serialize
11480 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11481{
11482 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11483 where
11484 S: serde::Serializer,
11485 {
11486 serializer.serialize_str(self.as_str())
11487 }
11488}
11489#[cfg(feature = "deserialize")]
11490impl<'de> serde::Deserialize<'de>
11491 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11492{
11493 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11494 use std::str::FromStr;
11495 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11496 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
11497 }
11498}
11499#[derive(Copy, Clone, Eq, PartialEq)]
11501pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11502 V1_0_2,
11503 V2_1_0,
11504 V2_2_0,
11505}
11506impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11507 pub fn as_str(self) -> &'static str {
11508 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11509 match self {
11510 V1_0_2 => "1.0.2",
11511 V2_1_0 => "2.1.0",
11512 V2_2_0 => "2.2.0",
11513 }
11514 }
11515}
11516
11517impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11518 type Err = stripe_types::StripeParseError;
11519 fn from_str(s: &str) -> Result<Self, Self::Err> {
11520 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11521 match s {
11522 "1.0.2" => Ok(V1_0_2),
11523 "2.1.0" => Ok(V2_1_0),
11524 "2.2.0" => Ok(V2_2_0),
11525 _ => Err(stripe_types::StripeParseError),
11526 }
11527 }
11528}
11529impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11530 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11531 f.write_str(self.as_str())
11532 }
11533}
11534
11535impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11536 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11537 f.write_str(self.as_str())
11538 }
11539}
11540impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11541 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11542 where
11543 S: serde::Serializer,
11544 {
11545 serializer.serialize_str(self.as_str())
11546 }
11547}
11548#[cfg(feature = "deserialize")]
11549impl<'de> serde::Deserialize<'de>
11550 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
11551{
11552 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11553 use std::str::FromStr;
11554 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11555 Self::from_str(&s).map_err(|_| {
11556 serde::de::Error::custom(
11557 "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
11558 )
11559 })
11560 }
11561}
11562#[derive(Clone, Debug, serde::Serialize)]
11564pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
11565 #[serde(skip_serializing_if = "Option::is_none")]
11567 pub currency: Option<stripe_types::Currency>,
11568 #[serde(skip_serializing_if = "Option::is_none")]
11570 pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
11571 #[serde(skip_serializing_if = "Option::is_none")]
11573 pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
11574 #[serde(skip_serializing_if = "Option::is_none")]
11576 pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
11577}
11578impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
11579 pub fn new() -> Self {
11580 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
11581 }
11582}
11583impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
11584 fn default() -> Self {
11585 Self::new()
11586 }
11587}
11588#[derive(Copy, Clone, Debug, serde::Serialize)]
11590pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11591 #[serde(skip_serializing_if = "Option::is_none")]
11594 pub average_amount: Option<i64>,
11595 #[serde(skip_serializing_if = "Option::is_none")]
11598 pub maximum_amount: Option<i64>,
11599 #[serde(skip_serializing_if = "Option::is_none")]
11602 pub minimum_amount: Option<i64>,
11603 #[serde(skip_serializing_if = "Option::is_none")]
11605 pub purchase_interval:
11606 Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
11607 #[serde(skip_serializing_if = "Option::is_none")]
11609 pub purchase_interval_count: Option<u64>,
11610}
11611impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11612 pub fn new() -> Self {
11613 Self {
11614 average_amount: None,
11615 maximum_amount: None,
11616 minimum_amount: None,
11617 purchase_interval: None,
11618 purchase_interval_count: None,
11619 }
11620 }
11621}
11622impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11623 fn default() -> Self {
11624 Self::new()
11625 }
11626}
11627#[derive(Copy, Clone, Eq, PartialEq)]
11629pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11630 Day,
11631 Month,
11632 Week,
11633 Year,
11634}
11635impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11636 pub fn as_str(self) -> &'static str {
11637 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11638 match self {
11639 Day => "day",
11640 Month => "month",
11641 Week => "week",
11642 Year => "year",
11643 }
11644 }
11645}
11646
11647impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11648 type Err = stripe_types::StripeParseError;
11649 fn from_str(s: &str) -> Result<Self, Self::Err> {
11650 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11651 match s {
11652 "day" => Ok(Day),
11653 "month" => Ok(Month),
11654 "week" => Ok(Week),
11655 "year" => Ok(Year),
11656 _ => Err(stripe_types::StripeParseError),
11657 }
11658 }
11659}
11660impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11661 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11662 f.write_str(self.as_str())
11663 }
11664}
11665
11666impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11667 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11668 f.write_str(self.as_str())
11669 }
11670}
11671impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11672 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11673 where
11674 S: serde::Serializer,
11675 {
11676 serializer.serialize_str(self.as_str())
11677 }
11678}
11679#[cfg(feature = "deserialize")]
11680impl<'de> serde::Deserialize<'de>
11681 for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
11682{
11683 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11684 use std::str::FromStr;
11685 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11686 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
11687 }
11688}
11689#[derive(Clone, Eq, PartialEq)]
11691#[non_exhaustive]
11692pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11693 CsMinusCz,
11694 DaMinusDk,
11695 DeMinusAt,
11696 DeMinusCh,
11697 DeMinusDe,
11698 ElMinusGr,
11699 EnMinusAt,
11700 EnMinusAu,
11701 EnMinusBe,
11702 EnMinusCa,
11703 EnMinusCh,
11704 EnMinusCz,
11705 EnMinusDe,
11706 EnMinusDk,
11707 EnMinusEs,
11708 EnMinusFi,
11709 EnMinusFr,
11710 EnMinusGb,
11711 EnMinusGr,
11712 EnMinusIe,
11713 EnMinusIt,
11714 EnMinusNl,
11715 EnMinusNo,
11716 EnMinusNz,
11717 EnMinusPl,
11718 EnMinusPt,
11719 EnMinusRo,
11720 EnMinusSe,
11721 EnMinusUs,
11722 EsMinusEs,
11723 EsMinusUs,
11724 FiMinusFi,
11725 FrMinusBe,
11726 FrMinusCa,
11727 FrMinusCh,
11728 FrMinusFr,
11729 ItMinusCh,
11730 ItMinusIt,
11731 NbMinusNo,
11732 NlMinusBe,
11733 NlMinusNl,
11734 PlMinusPl,
11735 PtMinusPt,
11736 RoMinusRo,
11737 SvMinusFi,
11738 SvMinusSe,
11739 Unknown(String),
11741}
11742impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11743 pub fn as_str(&self) -> &str {
11744 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11745 match self {
11746 CsMinusCz => "cs-CZ",
11747 DaMinusDk => "da-DK",
11748 DeMinusAt => "de-AT",
11749 DeMinusCh => "de-CH",
11750 DeMinusDe => "de-DE",
11751 ElMinusGr => "el-GR",
11752 EnMinusAt => "en-AT",
11753 EnMinusAu => "en-AU",
11754 EnMinusBe => "en-BE",
11755 EnMinusCa => "en-CA",
11756 EnMinusCh => "en-CH",
11757 EnMinusCz => "en-CZ",
11758 EnMinusDe => "en-DE",
11759 EnMinusDk => "en-DK",
11760 EnMinusEs => "en-ES",
11761 EnMinusFi => "en-FI",
11762 EnMinusFr => "en-FR",
11763 EnMinusGb => "en-GB",
11764 EnMinusGr => "en-GR",
11765 EnMinusIe => "en-IE",
11766 EnMinusIt => "en-IT",
11767 EnMinusNl => "en-NL",
11768 EnMinusNo => "en-NO",
11769 EnMinusNz => "en-NZ",
11770 EnMinusPl => "en-PL",
11771 EnMinusPt => "en-PT",
11772 EnMinusRo => "en-RO",
11773 EnMinusSe => "en-SE",
11774 EnMinusUs => "en-US",
11775 EsMinusEs => "es-ES",
11776 EsMinusUs => "es-US",
11777 FiMinusFi => "fi-FI",
11778 FrMinusBe => "fr-BE",
11779 FrMinusCa => "fr-CA",
11780 FrMinusCh => "fr-CH",
11781 FrMinusFr => "fr-FR",
11782 ItMinusCh => "it-CH",
11783 ItMinusIt => "it-IT",
11784 NbMinusNo => "nb-NO",
11785 NlMinusBe => "nl-BE",
11786 NlMinusNl => "nl-NL",
11787 PlMinusPl => "pl-PL",
11788 PtMinusPt => "pt-PT",
11789 RoMinusRo => "ro-RO",
11790 SvMinusFi => "sv-FI",
11791 SvMinusSe => "sv-SE",
11792 Unknown(v) => v,
11793 }
11794 }
11795}
11796
11797impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11798 type Err = std::convert::Infallible;
11799 fn from_str(s: &str) -> Result<Self, Self::Err> {
11800 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11801 match s {
11802 "cs-CZ" => Ok(CsMinusCz),
11803 "da-DK" => Ok(DaMinusDk),
11804 "de-AT" => Ok(DeMinusAt),
11805 "de-CH" => Ok(DeMinusCh),
11806 "de-DE" => Ok(DeMinusDe),
11807 "el-GR" => Ok(ElMinusGr),
11808 "en-AT" => Ok(EnMinusAt),
11809 "en-AU" => Ok(EnMinusAu),
11810 "en-BE" => Ok(EnMinusBe),
11811 "en-CA" => Ok(EnMinusCa),
11812 "en-CH" => Ok(EnMinusCh),
11813 "en-CZ" => Ok(EnMinusCz),
11814 "en-DE" => Ok(EnMinusDe),
11815 "en-DK" => Ok(EnMinusDk),
11816 "en-ES" => Ok(EnMinusEs),
11817 "en-FI" => Ok(EnMinusFi),
11818 "en-FR" => Ok(EnMinusFr),
11819 "en-GB" => Ok(EnMinusGb),
11820 "en-GR" => Ok(EnMinusGr),
11821 "en-IE" => Ok(EnMinusIe),
11822 "en-IT" => Ok(EnMinusIt),
11823 "en-NL" => Ok(EnMinusNl),
11824 "en-NO" => Ok(EnMinusNo),
11825 "en-NZ" => Ok(EnMinusNz),
11826 "en-PL" => Ok(EnMinusPl),
11827 "en-PT" => Ok(EnMinusPt),
11828 "en-RO" => Ok(EnMinusRo),
11829 "en-SE" => Ok(EnMinusSe),
11830 "en-US" => Ok(EnMinusUs),
11831 "es-ES" => Ok(EsMinusEs),
11832 "es-US" => Ok(EsMinusUs),
11833 "fi-FI" => Ok(FiMinusFi),
11834 "fr-BE" => Ok(FrMinusBe),
11835 "fr-CA" => Ok(FrMinusCa),
11836 "fr-CH" => Ok(FrMinusCh),
11837 "fr-FR" => Ok(FrMinusFr),
11838 "it-CH" => Ok(ItMinusCh),
11839 "it-IT" => Ok(ItMinusIt),
11840 "nb-NO" => Ok(NbMinusNo),
11841 "nl-BE" => Ok(NlMinusBe),
11842 "nl-NL" => Ok(NlMinusNl),
11843 "pl-PL" => Ok(PlMinusPl),
11844 "pt-PT" => Ok(PtMinusPt),
11845 "ro-RO" => Ok(RoMinusRo),
11846 "sv-FI" => Ok(SvMinusFi),
11847 "sv-SE" => Ok(SvMinusSe),
11848 v => Ok(Unknown(v.to_owned())),
11849 }
11850 }
11851}
11852impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11853 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11854 f.write_str(self.as_str())
11855 }
11856}
11857
11858impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11859 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11860 f.write_str(self.as_str())
11861 }
11862}
11863impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11864 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11865 where
11866 S: serde::Serializer,
11867 {
11868 serializer.serialize_str(self.as_str())
11869 }
11870}
11871#[cfg(feature = "deserialize")]
11872impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11873 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11874 use std::str::FromStr;
11875 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11876 Ok(Self::from_str(&s).unwrap())
11877 }
11878}
11879#[derive(Clone, Debug, serde::Serialize)]
11881pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11882 pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
11884 #[serde(skip_serializing_if = "Option::is_none")]
11887 pub interval_count: Option<u64>,
11888 #[serde(skip_serializing_if = "Option::is_none")]
11890 pub name: Option<String>,
11891 pub next_billing: SubscriptionNextBillingParam,
11893 pub reference: String,
11896}
11897impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11898 pub fn new(
11899 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
11900 next_billing: impl Into<SubscriptionNextBillingParam>,
11901 reference: impl Into<String>,
11902 ) -> Self {
11903 Self {
11904 interval: interval.into(),
11905 interval_count: None,
11906 name: None,
11907 next_billing: next_billing.into(),
11908 reference: reference.into(),
11909 }
11910 }
11911}
11912#[derive(Copy, Clone, Eq, PartialEq)]
11914pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11915 Day,
11916 Month,
11917 Week,
11918 Year,
11919}
11920impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11921 pub fn as_str(self) -> &'static str {
11922 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11923 match self {
11924 Day => "day",
11925 Month => "month",
11926 Week => "week",
11927 Year => "year",
11928 }
11929 }
11930}
11931
11932impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11933 type Err = stripe_types::StripeParseError;
11934 fn from_str(s: &str) -> Result<Self, Self::Err> {
11935 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11936 match s {
11937 "day" => Ok(Day),
11938 "month" => Ok(Month),
11939 "week" => Ok(Week),
11940 "year" => Ok(Year),
11941 _ => Err(stripe_types::StripeParseError),
11942 }
11943 }
11944}
11945impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11946 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11947 f.write_str(self.as_str())
11948 }
11949}
11950
11951impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11952 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11953 f.write_str(self.as_str())
11954 }
11955}
11956impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11957 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11958 where
11959 S: serde::Serializer,
11960 {
11961 serializer.serialize_str(self.as_str())
11962 }
11963}
11964#[cfg(feature = "deserialize")]
11965impl<'de> serde::Deserialize<'de>
11966 for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
11967{
11968 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11969 use std::str::FromStr;
11970 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11971 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
11972 }
11973}
11974#[derive(Clone, Debug, serde::Serialize)]
11976pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
11977 #[serde(skip_serializing_if = "Option::is_none")]
11979 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
11980}
11981impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
11982 pub fn new() -> Self {
11983 Self { mandate_options: None }
11984 }
11985}
11986impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
11987 fn default() -> Self {
11988 Self::new()
11989 }
11990}
11991#[derive(Clone, Debug, serde::Serialize)]
11993pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
11994 #[serde(skip_serializing_if = "Option::is_none")]
11999 pub reference_prefix: Option<String>,
12000}
12001impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12002 pub fn new() -> Self {
12003 Self { reference_prefix: None }
12004 }
12005}
12006impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12007 fn default() -> Self {
12008 Self::new()
12009 }
12010}
12011#[derive(Clone, Debug, serde::Serialize)]
12013pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12014 #[serde(skip_serializing_if = "Option::is_none")]
12016 pub financial_connections:
12017 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
12018 #[serde(skip_serializing_if = "Option::is_none")]
12020 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
12021 #[serde(skip_serializing_if = "Option::is_none")]
12023 pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
12024 #[serde(skip_serializing_if = "Option::is_none")]
12026 pub verification_method:
12027 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
12028}
12029impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12030 pub fn new() -> Self {
12031 Self {
12032 financial_connections: None,
12033 mandate_options: None,
12034 networks: None,
12035 verification_method: None,
12036 }
12037 }
12038}
12039impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12040 fn default() -> Self {
12041 Self::new()
12042 }
12043}
12044#[derive(Clone, Debug, serde::Serialize)]
12046pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12047 #[serde(skip_serializing_if = "Option::is_none")]
12049 pub filters:
12050 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
12051 #[serde(skip_serializing_if = "Option::is_none")]
12055 pub permissions: Option<
12056 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
12057 >,
12058 #[serde(skip_serializing_if = "Option::is_none")]
12060 pub prefetch: Option<
12061 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
12062 >,
12063 #[serde(skip_serializing_if = "Option::is_none")]
12066 pub return_url: Option<String>,
12067}
12068impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12069 pub fn new() -> Self {
12070 Self { filters: None, permissions: None, prefetch: None, return_url: None }
12071 }
12072}
12073impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12074 fn default() -> Self {
12075 Self::new()
12076 }
12077}
12078#[derive(Clone, Debug, serde::Serialize)]
12080pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12081 #[serde(skip_serializing_if = "Option::is_none")]
12084pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
12085
12086}
12087impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12088 pub fn new() -> Self {
12089 Self { account_subcategories: None }
12090 }
12091}
12092impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12093 fn default() -> Self {
12094 Self::new()
12095 }
12096}
12097#[derive(Copy, Clone, Eq, PartialEq)]
12100pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
12101{
12102 Checking,
12103 Savings,
12104}
12105impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12106 pub fn as_str(self) -> &'static str {
12107 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12108 match self {
12109Checking => "checking",
12110Savings => "savings",
12111
12112 }
12113 }
12114}
12115
12116impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12117 type Err = stripe_types::StripeParseError;
12118 fn from_str(s: &str) -> Result<Self, Self::Err> {
12119 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12120 match s {
12121 "checking" => Ok(Checking),
12122"savings" => Ok(Savings),
12123_ => Err(stripe_types::StripeParseError)
12124
12125 }
12126 }
12127}
12128impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12129 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12130 f.write_str(self.as_str())
12131 }
12132}
12133
12134impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12135 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12136 f.write_str(self.as_str())
12137 }
12138}
12139impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12140 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
12141 serializer.serialize_str(self.as_str())
12142 }
12143}
12144#[cfg(feature = "deserialize")]
12145impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12146 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12147 use std::str::FromStr;
12148 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12149 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
12150 }
12151}
12152#[derive(Copy, Clone, Eq, PartialEq)]
12156pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12157 Balances,
12158 Ownership,
12159 PaymentMethod,
12160 Transactions,
12161}
12162impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12163 pub fn as_str(self) -> &'static str {
12164 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12165 match self {
12166 Balances => "balances",
12167 Ownership => "ownership",
12168 PaymentMethod => "payment_method",
12169 Transactions => "transactions",
12170 }
12171 }
12172}
12173
12174impl std::str::FromStr
12175 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12176{
12177 type Err = stripe_types::StripeParseError;
12178 fn from_str(s: &str) -> Result<Self, Self::Err> {
12179 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12180 match s {
12181 "balances" => Ok(Balances),
12182 "ownership" => Ok(Ownership),
12183 "payment_method" => Ok(PaymentMethod),
12184 "transactions" => Ok(Transactions),
12185 _ => Err(stripe_types::StripeParseError),
12186 }
12187 }
12188}
12189impl std::fmt::Display
12190 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12191{
12192 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12193 f.write_str(self.as_str())
12194 }
12195}
12196
12197impl std::fmt::Debug
12198 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12199{
12200 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12201 f.write_str(self.as_str())
12202 }
12203}
12204impl serde::Serialize
12205 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12206{
12207 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12208 where
12209 S: serde::Serializer,
12210 {
12211 serializer.serialize_str(self.as_str())
12212 }
12213}
12214#[cfg(feature = "deserialize")]
12215impl<'de> serde::Deserialize<'de>
12216 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12217{
12218 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12219 use std::str::FromStr;
12220 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12221 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
12222 }
12223}
12224#[derive(Copy, Clone, Eq, PartialEq)]
12226pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12227 Balances,
12228 Ownership,
12229 Transactions,
12230}
12231impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12232 pub fn as_str(self) -> &'static str {
12233 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12234 match self {
12235 Balances => "balances",
12236 Ownership => "ownership",
12237 Transactions => "transactions",
12238 }
12239 }
12240}
12241
12242impl std::str::FromStr
12243 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12244{
12245 type Err = stripe_types::StripeParseError;
12246 fn from_str(s: &str) -> Result<Self, Self::Err> {
12247 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12248 match s {
12249 "balances" => Ok(Balances),
12250 "ownership" => Ok(Ownership),
12251 "transactions" => Ok(Transactions),
12252 _ => Err(stripe_types::StripeParseError),
12253 }
12254 }
12255}
12256impl std::fmt::Display
12257 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12258{
12259 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12260 f.write_str(self.as_str())
12261 }
12262}
12263
12264impl std::fmt::Debug
12265 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12266{
12267 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12268 f.write_str(self.as_str())
12269 }
12270}
12271impl serde::Serialize
12272 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12273{
12274 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12275 where
12276 S: serde::Serializer,
12277 {
12278 serializer.serialize_str(self.as_str())
12279 }
12280}
12281#[cfg(feature = "deserialize")]
12282impl<'de> serde::Deserialize<'de>
12283 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12284{
12285 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12286 use std::str::FromStr;
12287 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12288 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
12289 }
12290}
12291#[derive(Copy, Clone, Debug, serde::Serialize)]
12293pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12294 #[serde(skip_serializing_if = "Option::is_none")]
12296 pub collection_method:
12297 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
12298}
12299impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12300 pub fn new() -> Self {
12301 Self { collection_method: None }
12302 }
12303}
12304impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12305 fn default() -> Self {
12306 Self::new()
12307 }
12308}
12309#[derive(Copy, Clone, Eq, PartialEq)]
12311pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12312 Paper,
12313}
12314impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12315 pub fn as_str(self) -> &'static str {
12316 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12317 match self {
12318 Paper => "paper",
12319 }
12320 }
12321}
12322
12323impl std::str::FromStr
12324 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12325{
12326 type Err = stripe_types::StripeParseError;
12327 fn from_str(s: &str) -> Result<Self, Self::Err> {
12328 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12329 match s {
12330 "paper" => Ok(Paper),
12331 _ => Err(stripe_types::StripeParseError),
12332 }
12333 }
12334}
12335impl std::fmt::Display
12336 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12337{
12338 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12339 f.write_str(self.as_str())
12340 }
12341}
12342
12343impl std::fmt::Debug
12344 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12345{
12346 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12347 f.write_str(self.as_str())
12348 }
12349}
12350impl serde::Serialize
12351 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12352{
12353 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12354 where
12355 S: serde::Serializer,
12356 {
12357 serializer.serialize_str(self.as_str())
12358 }
12359}
12360#[cfg(feature = "deserialize")]
12361impl<'de> serde::Deserialize<'de>
12362 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12363{
12364 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12365 use std::str::FromStr;
12366 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12367 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
12368 }
12369}
12370#[derive(Clone, Debug, serde::Serialize)]
12372pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12373 #[serde(skip_serializing_if = "Option::is_none")]
12375 pub requested:
12376 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
12377}
12378impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12379 pub fn new() -> Self {
12380 Self { requested: None }
12381 }
12382}
12383impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12384 fn default() -> Self {
12385 Self::new()
12386 }
12387}
12388#[derive(Copy, Clone, Eq, PartialEq)]
12390pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12391 Ach,
12392 UsDomesticWire,
12393}
12394impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12395 pub fn as_str(self) -> &'static str {
12396 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12397 match self {
12398 Ach => "ach",
12399 UsDomesticWire => "us_domestic_wire",
12400 }
12401 }
12402}
12403
12404impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12405 type Err = stripe_types::StripeParseError;
12406 fn from_str(s: &str) -> Result<Self, Self::Err> {
12407 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12408 match s {
12409 "ach" => Ok(Ach),
12410 "us_domestic_wire" => Ok(UsDomesticWire),
12411 _ => Err(stripe_types::StripeParseError),
12412 }
12413 }
12414}
12415impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12416 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12417 f.write_str(self.as_str())
12418 }
12419}
12420
12421impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12422 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12423 f.write_str(self.as_str())
12424 }
12425}
12426impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12427 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12428 where
12429 S: serde::Serializer,
12430 {
12431 serializer.serialize_str(self.as_str())
12432 }
12433}
12434#[cfg(feature = "deserialize")]
12435impl<'de> serde::Deserialize<'de>
12436 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
12437{
12438 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12439 use std::str::FromStr;
12440 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12441 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
12442 }
12443}
12444#[derive(Copy, Clone, Eq, PartialEq)]
12446pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12447 Automatic,
12448 Instant,
12449 Microdeposits,
12450}
12451impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12452 pub fn as_str(self) -> &'static str {
12453 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12454 match self {
12455 Automatic => "automatic",
12456 Instant => "instant",
12457 Microdeposits => "microdeposits",
12458 }
12459 }
12460}
12461
12462impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12463 type Err = stripe_types::StripeParseError;
12464 fn from_str(s: &str) -> Result<Self, Self::Err> {
12465 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12466 match s {
12467 "automatic" => Ok(Automatic),
12468 "instant" => Ok(Instant),
12469 "microdeposits" => Ok(Microdeposits),
12470 _ => Err(stripe_types::StripeParseError),
12471 }
12472 }
12473}
12474impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12475 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12476 f.write_str(self.as_str())
12477 }
12478}
12479
12480impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12481 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12482 f.write_str(self.as_str())
12483 }
12484}
12485impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12486 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12487 where
12488 S: serde::Serializer,
12489 {
12490 serializer.serialize_str(self.as_str())
12491 }
12492}
12493#[cfg(feature = "deserialize")]
12494impl<'de> serde::Deserialize<'de>
12495 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12496{
12497 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12498 use std::str::FromStr;
12499 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12500 Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
12501 }
12502}
12503#[derive(Clone, Debug, serde::Serialize)]
12518pub struct ConfirmSetupIntent {
12519 inner: ConfirmSetupIntentBuilder,
12520 intent: stripe_shared::SetupIntentId,
12521}
12522impl ConfirmSetupIntent {
12523 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12525 Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
12526 }
12527 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
12531 self.inner.confirmation_token = Some(confirmation_token.into());
12532 self
12533 }
12534 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12536 self.inner.expand = Some(expand.into());
12537 self
12538 }
12539 pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
12540 self.inner.mandate_data = Some(mandate_data.into());
12541 self
12542 }
12543 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
12545 self.inner.payment_method = Some(payment_method.into());
12546 self
12547 }
12548 pub fn payment_method_data(
12551 mut self,
12552 payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
12553 ) -> Self {
12554 self.inner.payment_method_data = Some(payment_method_data.into());
12555 self
12556 }
12557 pub fn payment_method_options(
12559 mut self,
12560 payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
12561 ) -> Self {
12562 self.inner.payment_method_options = Some(payment_method_options.into());
12563 self
12564 }
12565 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
12569 self.inner.return_url = Some(return_url.into());
12570 self
12571 }
12572 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
12574 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
12575 self
12576 }
12577}
12578impl ConfirmSetupIntent {
12579 pub async fn send<C: StripeClient>(
12581 &self,
12582 client: &C,
12583 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12584 self.customize().send(client).await
12585 }
12586
12587 pub fn send_blocking<C: StripeBlockingClient>(
12589 &self,
12590 client: &C,
12591 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12592 self.customize().send_blocking(client)
12593 }
12594}
12595
12596impl StripeRequest for ConfirmSetupIntent {
12597 type Output = stripe_shared::SetupIntent;
12598
12599 fn build(&self) -> RequestBuilder {
12600 let intent = &self.intent;
12601 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
12602 .form(&self.inner)
12603 }
12604}
12605#[derive(Clone, Debug, serde::Serialize)]
12606struct VerifyMicrodepositsSetupIntentBuilder {
12607 #[serde(skip_serializing_if = "Option::is_none")]
12608 amounts: Option<Vec<i64>>,
12609 #[serde(skip_serializing_if = "Option::is_none")]
12610 descriptor_code: Option<String>,
12611 #[serde(skip_serializing_if = "Option::is_none")]
12612 expand: Option<Vec<String>>,
12613}
12614impl VerifyMicrodepositsSetupIntentBuilder {
12615 fn new() -> Self {
12616 Self { amounts: None, descriptor_code: None, expand: None }
12617 }
12618}
12619#[derive(Clone, Debug, serde::Serialize)]
12621pub struct VerifyMicrodepositsSetupIntent {
12622 inner: VerifyMicrodepositsSetupIntentBuilder,
12623 intent: stripe_shared::SetupIntentId,
12624}
12625impl VerifyMicrodepositsSetupIntent {
12626 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12628 Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
12629 }
12630 pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
12632 self.inner.amounts = Some(amounts.into());
12633 self
12634 }
12635 pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
12637 self.inner.descriptor_code = Some(descriptor_code.into());
12638 self
12639 }
12640 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12642 self.inner.expand = Some(expand.into());
12643 self
12644 }
12645}
12646impl VerifyMicrodepositsSetupIntent {
12647 pub async fn send<C: StripeClient>(
12649 &self,
12650 client: &C,
12651 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12652 self.customize().send(client).await
12653 }
12654
12655 pub fn send_blocking<C: StripeBlockingClient>(
12657 &self,
12658 client: &C,
12659 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12660 self.customize().send_blocking(client)
12661 }
12662}
12663
12664impl StripeRequest for VerifyMicrodepositsSetupIntent {
12665 type Output = stripe_shared::SetupIntent;
12666
12667 fn build(&self) -> RequestBuilder {
12668 let intent = &self.intent;
12669 RequestBuilder::new(
12670 StripeMethod::Post,
12671 format!("/setup_intents/{intent}/verify_microdeposits"),
12672 )
12673 .form(&self.inner)
12674 }
12675}
12676
12677#[derive(Clone, Debug, serde::Serialize)]
12678pub struct OnlineParam {
12679 pub ip_address: String,
12681 pub user_agent: String,
12683}
12684impl OnlineParam {
12685 pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
12686 Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
12687 }
12688}
12689#[derive(Clone, Debug, serde::Serialize)]
12690pub struct PaymentMethodParam {
12691 pub account_number: String,
12693 pub institution_number: String,
12695 pub transit_number: String,
12697}
12698impl PaymentMethodParam {
12699 pub fn new(
12700 account_number: impl Into<String>,
12701 institution_number: impl Into<String>,
12702 transit_number: impl Into<String>,
12703 ) -> Self {
12704 Self {
12705 account_number: account_number.into(),
12706 institution_number: institution_number.into(),
12707 transit_number: transit_number.into(),
12708 }
12709 }
12710}
12711#[derive(Clone, Debug, serde::Serialize)]
12712pub struct BillingDetailsAddress {
12713 #[serde(skip_serializing_if = "Option::is_none")]
12715 pub city: Option<String>,
12716 #[serde(skip_serializing_if = "Option::is_none")]
12718 pub country: Option<String>,
12719 #[serde(skip_serializing_if = "Option::is_none")]
12721 pub line1: Option<String>,
12722 #[serde(skip_serializing_if = "Option::is_none")]
12724 pub line2: Option<String>,
12725 #[serde(skip_serializing_if = "Option::is_none")]
12727 pub postal_code: Option<String>,
12728 #[serde(skip_serializing_if = "Option::is_none")]
12730 pub state: Option<String>,
12731}
12732impl BillingDetailsAddress {
12733 pub fn new() -> Self {
12734 Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12735 }
12736}
12737impl Default for BillingDetailsAddress {
12738 fn default() -> Self {
12739 Self::new()
12740 }
12741}
12742#[derive(Copy, Clone, Debug, serde::Serialize)]
12743pub struct DateOfBirth {
12744 pub day: i64,
12746 pub month: i64,
12748 pub year: i64,
12750}
12751impl DateOfBirth {
12752 pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
12753 Self { day: day.into(), month: month.into(), year: year.into() }
12754 }
12755}
12756#[derive(Clone, Debug, serde::Serialize)]
12757pub struct RadarOptionsWithHiddenOptions {
12758 #[serde(skip_serializing_if = "Option::is_none")]
12760 pub session: Option<String>,
12761}
12762impl RadarOptionsWithHiddenOptions {
12763 pub fn new() -> Self {
12764 Self { session: None }
12765 }
12766}
12767impl Default for RadarOptionsWithHiddenOptions {
12768 fn default() -> Self {
12769 Self::new()
12770 }
12771}
12772#[derive(Clone, Debug, serde::Serialize)]
12773pub struct PaymentMethodOptionsMandateOptionsParam {
12774 #[serde(skip_serializing_if = "Option::is_none")]
12779 pub reference_prefix: Option<String>,
12780}
12781impl PaymentMethodOptionsMandateOptionsParam {
12782 pub fn new() -> Self {
12783 Self { reference_prefix: None }
12784 }
12785}
12786impl Default for PaymentMethodOptionsMandateOptionsParam {
12787 fn default() -> Self {
12788 Self::new()
12789 }
12790}
12791#[derive(Clone, Debug, serde::Serialize)]
12792pub struct SubscriptionNextBillingParam {
12793 pub amount: i64,
12795 pub date: String,
12797}
12798impl SubscriptionNextBillingParam {
12799 pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
12800 Self { amount: amount.into(), date: date.into() }
12801 }
12802}
12803#[derive(Clone, Debug, serde::Serialize)]
12804pub struct SetupIntentPaymentMethodOptionsParam {
12805 #[serde(skip_serializing_if = "Option::is_none")]
12807 pub persistent_token: Option<String>,
12808}
12809impl SetupIntentPaymentMethodOptionsParam {
12810 pub fn new() -> Self {
12811 Self { persistent_token: None }
12812 }
12813}
12814impl Default for SetupIntentPaymentMethodOptionsParam {
12815 fn default() -> Self {
12816 Self::new()
12817 }
12818}
12819#[derive(Clone, Debug, serde::Serialize)]
12820pub struct PaymentMethodOptionsParam {
12821 #[serde(skip_serializing_if = "Option::is_none")]
12824 pub billing_agreement_id: Option<String>,
12825}
12826impl PaymentMethodOptionsParam {
12827 pub fn new() -> Self {
12828 Self { billing_agreement_id: None }
12829 }
12830}
12831impl Default for PaymentMethodOptionsParam {
12832 fn default() -> Self {
12833 Self::new()
12834 }
12835}
12836#[derive(Clone, Debug, serde::Serialize)]
12837pub struct BillingDetailsInnerParams {
12838 #[serde(skip_serializing_if = "Option::is_none")]
12840 pub address: Option<BillingDetailsAddress>,
12841 #[serde(skip_serializing_if = "Option::is_none")]
12843 pub email: Option<String>,
12844 #[serde(skip_serializing_if = "Option::is_none")]
12846 pub name: Option<String>,
12847 #[serde(skip_serializing_if = "Option::is_none")]
12849 pub phone: Option<String>,
12850 #[serde(skip_serializing_if = "Option::is_none")]
12853 pub tax_id: Option<String>,
12854}
12855impl BillingDetailsInnerParams {
12856 pub fn new() -> Self {
12857 Self { address: None, email: None, name: None, phone: None, tax_id: None }
12858 }
12859}
12860impl Default for BillingDetailsInnerParams {
12861 fn default() -> Self {
12862 Self::new()
12863 }
12864}