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 excluded_payment_method_types:
218 Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
219 #[serde(skip_serializing_if = "Option::is_none")]
220 expand: Option<Vec<String>>,
221 #[serde(skip_serializing_if = "Option::is_none")]
222 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
223 #[serde(skip_serializing_if = "Option::is_none")]
224 mandate_data: Option<CreateSetupIntentMandateData>,
225 #[serde(skip_serializing_if = "Option::is_none")]
226 metadata: Option<std::collections::HashMap<String, String>>,
227 #[serde(skip_serializing_if = "Option::is_none")]
228 on_behalf_of: Option<String>,
229 #[serde(skip_serializing_if = "Option::is_none")]
230 payment_method: Option<String>,
231 #[serde(skip_serializing_if = "Option::is_none")]
232 payment_method_configuration: Option<String>,
233 #[serde(skip_serializing_if = "Option::is_none")]
234 payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
235 #[serde(skip_serializing_if = "Option::is_none")]
236 payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
237 #[serde(skip_serializing_if = "Option::is_none")]
238 payment_method_types: Option<Vec<String>>,
239 #[serde(skip_serializing_if = "Option::is_none")]
240 return_url: Option<String>,
241 #[serde(skip_serializing_if = "Option::is_none")]
242 single_use: Option<CreateSetupIntentSingleUse>,
243 #[serde(skip_serializing_if = "Option::is_none")]
244 usage: Option<CreateSetupIntentUsage>,
245 #[serde(skip_serializing_if = "Option::is_none")]
246 use_stripe_sdk: Option<bool>,
247}
248impl CreateSetupIntentBuilder {
249 fn new() -> Self {
250 Self {
251 attach_to_self: None,
252 automatic_payment_methods: None,
253 confirm: None,
254 confirmation_token: None,
255 customer: None,
256 description: None,
257 excluded_payment_method_types: None,
258 expand: None,
259 flow_directions: None,
260 mandate_data: None,
261 metadata: None,
262 on_behalf_of: None,
263 payment_method: None,
264 payment_method_configuration: None,
265 payment_method_data: None,
266 payment_method_options: None,
267 payment_method_types: None,
268 return_url: None,
269 single_use: None,
270 usage: None,
271 use_stripe_sdk: None,
272 }
273 }
274}
275#[derive(Clone, Debug, serde::Serialize)]
277pub struct CreateSetupIntentAutomaticPaymentMethods {
278 #[serde(skip_serializing_if = "Option::is_none")]
283 pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
284 pub enabled: bool,
286}
287impl CreateSetupIntentAutomaticPaymentMethods {
288 pub fn new(enabled: impl Into<bool>) -> Self {
289 Self { allow_redirects: None, enabled: enabled.into() }
290 }
291}
292#[derive(Clone, Eq, PartialEq)]
297#[non_exhaustive]
298pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
299 Always,
300 Never,
301 Unknown(String),
303}
304impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
305 pub fn as_str(&self) -> &str {
306 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
307 match self {
308 Always => "always",
309 Never => "never",
310 Unknown(v) => v,
311 }
312 }
313}
314
315impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
316 type Err = std::convert::Infallible;
317 fn from_str(s: &str) -> Result<Self, Self::Err> {
318 use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
319 match s {
320 "always" => Ok(Always),
321 "never" => Ok(Never),
322 v => {
323 tracing::warn!(
324 "Unknown value '{}' for enum '{}'",
325 v,
326 "CreateSetupIntentAutomaticPaymentMethodsAllowRedirects"
327 );
328 Ok(Unknown(v.to_owned()))
329 }
330 }
331 }
332}
333impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
334 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
335 f.write_str(self.as_str())
336 }
337}
338
339impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
340 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
341 f.write_str(self.as_str())
342 }
343}
344impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
345 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
346 where
347 S: serde::Serializer,
348 {
349 serializer.serialize_str(self.as_str())
350 }
351}
352#[cfg(feature = "deserialize")]
353impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
354 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
355 use std::str::FromStr;
356 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
357 Ok(Self::from_str(&s).expect("infallible"))
358 }
359}
360#[derive(Clone, Debug, serde::Serialize)]
363pub struct CreateSetupIntentMandateData {
364 pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
366}
367impl CreateSetupIntentMandateData {
368 pub fn new(
369 customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
370 ) -> Self {
371 Self { customer_acceptance: customer_acceptance.into() }
372 }
373}
374#[derive(Clone, Debug, serde::Serialize)]
376pub struct CreateSetupIntentMandateDataCustomerAcceptance {
377 #[serde(skip_serializing_if = "Option::is_none")]
379 pub accepted_at: Option<stripe_types::Timestamp>,
380 #[serde(skip_serializing_if = "Option::is_none")]
382 #[serde(with = "stripe_types::with_serde_json_opt")]
383 pub offline: Option<miniserde::json::Value>,
384 #[serde(skip_serializing_if = "Option::is_none")]
386 pub online: Option<OnlineParam>,
387 #[serde(rename = "type")]
390 pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
391}
392impl CreateSetupIntentMandateDataCustomerAcceptance {
393 pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
394 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
395 }
396}
397#[derive(Clone, Eq, PartialEq)]
400#[non_exhaustive]
401pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
402 Offline,
403 Online,
404 Unknown(String),
406}
407impl CreateSetupIntentMandateDataCustomerAcceptanceType {
408 pub fn as_str(&self) -> &str {
409 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
410 match self {
411 Offline => "offline",
412 Online => "online",
413 Unknown(v) => v,
414 }
415 }
416}
417
418impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
419 type Err = std::convert::Infallible;
420 fn from_str(s: &str) -> Result<Self, Self::Err> {
421 use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
422 match s {
423 "offline" => Ok(Offline),
424 "online" => Ok(Online),
425 v => {
426 tracing::warn!(
427 "Unknown value '{}' for enum '{}'",
428 v,
429 "CreateSetupIntentMandateDataCustomerAcceptanceType"
430 );
431 Ok(Unknown(v.to_owned()))
432 }
433 }
434 }
435}
436impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
437 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
438 f.write_str(self.as_str())
439 }
440}
441
442impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
443 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
444 f.write_str(self.as_str())
445 }
446}
447impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
448 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
449 where
450 S: serde::Serializer,
451 {
452 serializer.serialize_str(self.as_str())
453 }
454}
455#[cfg(feature = "deserialize")]
456impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
457 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
458 use std::str::FromStr;
459 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
460 Ok(Self::from_str(&s).expect("infallible"))
461 }
462}
463#[derive(Clone, Debug, serde::Serialize)]
466pub struct CreateSetupIntentPaymentMethodData {
467 #[serde(skip_serializing_if = "Option::is_none")]
469 pub acss_debit: Option<PaymentMethodParam>,
470 #[serde(skip_serializing_if = "Option::is_none")]
472 #[serde(with = "stripe_types::with_serde_json_opt")]
473 pub affirm: Option<miniserde::json::Value>,
474 #[serde(skip_serializing_if = "Option::is_none")]
476 #[serde(with = "stripe_types::with_serde_json_opt")]
477 pub afterpay_clearpay: Option<miniserde::json::Value>,
478 #[serde(skip_serializing_if = "Option::is_none")]
480 #[serde(with = "stripe_types::with_serde_json_opt")]
481 pub alipay: Option<miniserde::json::Value>,
482 #[serde(skip_serializing_if = "Option::is_none")]
486 pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
487 #[serde(skip_serializing_if = "Option::is_none")]
489 #[serde(with = "stripe_types::with_serde_json_opt")]
490 pub alma: Option<miniserde::json::Value>,
491 #[serde(skip_serializing_if = "Option::is_none")]
493 #[serde(with = "stripe_types::with_serde_json_opt")]
494 pub amazon_pay: Option<miniserde::json::Value>,
495 #[serde(skip_serializing_if = "Option::is_none")]
497 pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
498 #[serde(skip_serializing_if = "Option::is_none")]
500 pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
501 #[serde(skip_serializing_if = "Option::is_none")]
503 #[serde(with = "stripe_types::with_serde_json_opt")]
504 pub bancontact: Option<miniserde::json::Value>,
505 #[serde(skip_serializing_if = "Option::is_none")]
507 #[serde(with = "stripe_types::with_serde_json_opt")]
508 pub billie: Option<miniserde::json::Value>,
509 #[serde(skip_serializing_if = "Option::is_none")]
511 pub billing_details: Option<BillingDetailsInnerParams>,
512 #[serde(skip_serializing_if = "Option::is_none")]
514 #[serde(with = "stripe_types::with_serde_json_opt")]
515 pub blik: Option<miniserde::json::Value>,
516 #[serde(skip_serializing_if = "Option::is_none")]
518 pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
519 #[serde(skip_serializing_if = "Option::is_none")]
521 #[serde(with = "stripe_types::with_serde_json_opt")]
522 pub cashapp: Option<miniserde::json::Value>,
523 #[serde(skip_serializing_if = "Option::is_none")]
525 #[serde(with = "stripe_types::with_serde_json_opt")]
526 pub crypto: Option<miniserde::json::Value>,
527 #[serde(skip_serializing_if = "Option::is_none")]
529 #[serde(with = "stripe_types::with_serde_json_opt")]
530 pub customer_balance: Option<miniserde::json::Value>,
531 #[serde(skip_serializing_if = "Option::is_none")]
533 pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
534 #[serde(skip_serializing_if = "Option::is_none")]
536 pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
537 #[serde(skip_serializing_if = "Option::is_none")]
539 #[serde(with = "stripe_types::with_serde_json_opt")]
540 pub giropay: Option<miniserde::json::Value>,
541 #[serde(skip_serializing_if = "Option::is_none")]
543 #[serde(with = "stripe_types::with_serde_json_opt")]
544 pub grabpay: Option<miniserde::json::Value>,
545 #[serde(skip_serializing_if = "Option::is_none")]
547 pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
548 #[serde(skip_serializing_if = "Option::is_none")]
550 #[serde(with = "stripe_types::with_serde_json_opt")]
551 pub interac_present: Option<miniserde::json::Value>,
552 #[serde(skip_serializing_if = "Option::is_none")]
554 #[serde(with = "stripe_types::with_serde_json_opt")]
555 pub kakao_pay: Option<miniserde::json::Value>,
556 #[serde(skip_serializing_if = "Option::is_none")]
558 pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
559 #[serde(skip_serializing_if = "Option::is_none")]
561 #[serde(with = "stripe_types::with_serde_json_opt")]
562 pub konbini: Option<miniserde::json::Value>,
563 #[serde(skip_serializing_if = "Option::is_none")]
565 #[serde(with = "stripe_types::with_serde_json_opt")]
566 pub kr_card: Option<miniserde::json::Value>,
567 #[serde(skip_serializing_if = "Option::is_none")]
569 #[serde(with = "stripe_types::with_serde_json_opt")]
570 pub link: Option<miniserde::json::Value>,
571 #[serde(skip_serializing_if = "Option::is_none")]
573 #[serde(with = "stripe_types::with_serde_json_opt")]
574 pub mb_way: Option<miniserde::json::Value>,
575 #[serde(skip_serializing_if = "Option::is_none")]
580 pub metadata: Option<std::collections::HashMap<String, String>>,
581 #[serde(skip_serializing_if = "Option::is_none")]
583 #[serde(with = "stripe_types::with_serde_json_opt")]
584 pub mobilepay: Option<miniserde::json::Value>,
585 #[serde(skip_serializing_if = "Option::is_none")]
587 #[serde(with = "stripe_types::with_serde_json_opt")]
588 pub multibanco: Option<miniserde::json::Value>,
589 #[serde(skip_serializing_if = "Option::is_none")]
591 pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
592 #[serde(skip_serializing_if = "Option::is_none")]
594 pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
595 #[serde(skip_serializing_if = "Option::is_none")]
597 #[serde(with = "stripe_types::with_serde_json_opt")]
598 pub oxxo: Option<miniserde::json::Value>,
599 #[serde(skip_serializing_if = "Option::is_none")]
601 pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
602 #[serde(skip_serializing_if = "Option::is_none")]
604 #[serde(with = "stripe_types::with_serde_json_opt")]
605 pub pay_by_bank: Option<miniserde::json::Value>,
606 #[serde(skip_serializing_if = "Option::is_none")]
608 #[serde(with = "stripe_types::with_serde_json_opt")]
609 pub payco: Option<miniserde::json::Value>,
610 #[serde(skip_serializing_if = "Option::is_none")]
612 #[serde(with = "stripe_types::with_serde_json_opt")]
613 pub paynow: Option<miniserde::json::Value>,
614 #[serde(skip_serializing_if = "Option::is_none")]
616 #[serde(with = "stripe_types::with_serde_json_opt")]
617 pub paypal: Option<miniserde::json::Value>,
618 #[serde(skip_serializing_if = "Option::is_none")]
620 #[serde(with = "stripe_types::with_serde_json_opt")]
621 pub pix: Option<miniserde::json::Value>,
622 #[serde(skip_serializing_if = "Option::is_none")]
624 #[serde(with = "stripe_types::with_serde_json_opt")]
625 pub promptpay: Option<miniserde::json::Value>,
626 #[serde(skip_serializing_if = "Option::is_none")]
629 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
630 #[serde(skip_serializing_if = "Option::is_none")]
632 #[serde(with = "stripe_types::with_serde_json_opt")]
633 pub revolut_pay: Option<miniserde::json::Value>,
634 #[serde(skip_serializing_if = "Option::is_none")]
636 #[serde(with = "stripe_types::with_serde_json_opt")]
637 pub samsung_pay: Option<miniserde::json::Value>,
638 #[serde(skip_serializing_if = "Option::is_none")]
640 #[serde(with = "stripe_types::with_serde_json_opt")]
641 pub satispay: Option<miniserde::json::Value>,
642 #[serde(skip_serializing_if = "Option::is_none")]
644 pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
645 #[serde(skip_serializing_if = "Option::is_none")]
647 pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
648 #[serde(skip_serializing_if = "Option::is_none")]
650 #[serde(with = "stripe_types::with_serde_json_opt")]
651 pub swish: Option<miniserde::json::Value>,
652 #[serde(skip_serializing_if = "Option::is_none")]
654 #[serde(with = "stripe_types::with_serde_json_opt")]
655 pub twint: Option<miniserde::json::Value>,
656 #[serde(rename = "type")]
660 pub type_: CreateSetupIntentPaymentMethodDataType,
661 #[serde(skip_serializing_if = "Option::is_none")]
663 pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
664 #[serde(skip_serializing_if = "Option::is_none")]
666 #[serde(with = "stripe_types::with_serde_json_opt")]
667 pub wechat_pay: Option<miniserde::json::Value>,
668 #[serde(skip_serializing_if = "Option::is_none")]
670 #[serde(with = "stripe_types::with_serde_json_opt")]
671 pub zip: Option<miniserde::json::Value>,
672}
673impl CreateSetupIntentPaymentMethodData {
674 pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
675 Self {
676 acss_debit: None,
677 affirm: None,
678 afterpay_clearpay: None,
679 alipay: None,
680 allow_redisplay: None,
681 alma: None,
682 amazon_pay: None,
683 au_becs_debit: None,
684 bacs_debit: None,
685 bancontact: None,
686 billie: None,
687 billing_details: None,
688 blik: None,
689 boleto: None,
690 cashapp: None,
691 crypto: None,
692 customer_balance: None,
693 eps: None,
694 fpx: None,
695 giropay: None,
696 grabpay: None,
697 ideal: None,
698 interac_present: None,
699 kakao_pay: None,
700 klarna: None,
701 konbini: None,
702 kr_card: None,
703 link: None,
704 mb_way: None,
705 metadata: None,
706 mobilepay: None,
707 multibanco: None,
708 naver_pay: None,
709 nz_bank_account: None,
710 oxxo: None,
711 p24: None,
712 pay_by_bank: None,
713 payco: None,
714 paynow: None,
715 paypal: None,
716 pix: None,
717 promptpay: None,
718 radar_options: None,
719 revolut_pay: None,
720 samsung_pay: None,
721 satispay: None,
722 sepa_debit: None,
723 sofort: None,
724 swish: None,
725 twint: None,
726 type_: type_.into(),
727 us_bank_account: None,
728 wechat_pay: None,
729 zip: None,
730 }
731 }
732}
733#[derive(Clone, Eq, PartialEq)]
737#[non_exhaustive]
738pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
739 Always,
740 Limited,
741 Unspecified,
742 Unknown(String),
744}
745impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
746 pub fn as_str(&self) -> &str {
747 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
748 match self {
749 Always => "always",
750 Limited => "limited",
751 Unspecified => "unspecified",
752 Unknown(v) => v,
753 }
754 }
755}
756
757impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
758 type Err = std::convert::Infallible;
759 fn from_str(s: &str) -> Result<Self, Self::Err> {
760 use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
761 match s {
762 "always" => Ok(Always),
763 "limited" => Ok(Limited),
764 "unspecified" => Ok(Unspecified),
765 v => {
766 tracing::warn!(
767 "Unknown value '{}' for enum '{}'",
768 v,
769 "CreateSetupIntentPaymentMethodDataAllowRedisplay"
770 );
771 Ok(Unknown(v.to_owned()))
772 }
773 }
774 }
775}
776impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
777 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
778 f.write_str(self.as_str())
779 }
780}
781
782impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
783 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
784 f.write_str(self.as_str())
785 }
786}
787impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
788 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
789 where
790 S: serde::Serializer,
791 {
792 serializer.serialize_str(self.as_str())
793 }
794}
795#[cfg(feature = "deserialize")]
796impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
797 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
798 use std::str::FromStr;
799 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
800 Ok(Self::from_str(&s).expect("infallible"))
801 }
802}
803#[derive(Clone, Debug, serde::Serialize)]
805pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
806 pub account_number: String,
808 pub bsb_number: String,
810}
811impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
812 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
813 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
814 }
815}
816#[derive(Clone, Debug, serde::Serialize)]
818pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
819 #[serde(skip_serializing_if = "Option::is_none")]
821 pub account_number: Option<String>,
822 #[serde(skip_serializing_if = "Option::is_none")]
824 pub sort_code: Option<String>,
825}
826impl CreateSetupIntentPaymentMethodDataBacsDebit {
827 pub fn new() -> Self {
828 Self { account_number: None, sort_code: None }
829 }
830}
831impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
832 fn default() -> Self {
833 Self::new()
834 }
835}
836#[derive(Clone, Debug, serde::Serialize)]
838pub struct CreateSetupIntentPaymentMethodDataBoleto {
839 pub tax_id: String,
841}
842impl CreateSetupIntentPaymentMethodDataBoleto {
843 pub fn new(tax_id: impl Into<String>) -> Self {
844 Self { tax_id: tax_id.into() }
845 }
846}
847#[derive(Clone, Debug, serde::Serialize)]
849pub struct CreateSetupIntentPaymentMethodDataEps {
850 #[serde(skip_serializing_if = "Option::is_none")]
852 pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
853}
854impl CreateSetupIntentPaymentMethodDataEps {
855 pub fn new() -> Self {
856 Self { bank: None }
857 }
858}
859impl Default for CreateSetupIntentPaymentMethodDataEps {
860 fn default() -> Self {
861 Self::new()
862 }
863}
864#[derive(Clone, Eq, PartialEq)]
866#[non_exhaustive]
867pub enum CreateSetupIntentPaymentMethodDataEpsBank {
868 ArzteUndApothekerBank,
869 AustrianAnadiBankAg,
870 BankAustria,
871 BankhausCarlSpangler,
872 BankhausSchelhammerUndSchatteraAg,
873 BawagPskAg,
874 BksBankAg,
875 BrullKallmusBankAg,
876 BtvVierLanderBank,
877 CapitalBankGraweGruppeAg,
878 DeutscheBankAg,
879 Dolomitenbank,
880 EasybankAg,
881 ErsteBankUndSparkassen,
882 HypoAlpeadriabankInternationalAg,
883 HypoBankBurgenlandAktiengesellschaft,
884 HypoNoeLbFurNiederosterreichUWien,
885 HypoOberosterreichSalzburgSteiermark,
886 HypoTirolBankAg,
887 HypoVorarlbergBankAg,
888 MarchfelderBank,
889 OberbankAg,
890 RaiffeisenBankengruppeOsterreich,
891 SchoellerbankAg,
892 SpardaBankWien,
893 VolksbankGruppe,
894 VolkskreditbankAg,
895 VrBankBraunau,
896 Unknown(String),
898}
899impl CreateSetupIntentPaymentMethodDataEpsBank {
900 pub fn as_str(&self) -> &str {
901 use CreateSetupIntentPaymentMethodDataEpsBank::*;
902 match self {
903 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
904 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
905 BankAustria => "bank_austria",
906 BankhausCarlSpangler => "bankhaus_carl_spangler",
907 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
908 BawagPskAg => "bawag_psk_ag",
909 BksBankAg => "bks_bank_ag",
910 BrullKallmusBankAg => "brull_kallmus_bank_ag",
911 BtvVierLanderBank => "btv_vier_lander_bank",
912 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
913 DeutscheBankAg => "deutsche_bank_ag",
914 Dolomitenbank => "dolomitenbank",
915 EasybankAg => "easybank_ag",
916 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
917 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
918 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
919 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
920 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
921 HypoTirolBankAg => "hypo_tirol_bank_ag",
922 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
923 MarchfelderBank => "marchfelder_bank",
924 OberbankAg => "oberbank_ag",
925 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
926 SchoellerbankAg => "schoellerbank_ag",
927 SpardaBankWien => "sparda_bank_wien",
928 VolksbankGruppe => "volksbank_gruppe",
929 VolkskreditbankAg => "volkskreditbank_ag",
930 VrBankBraunau => "vr_bank_braunau",
931 Unknown(v) => v,
932 }
933 }
934}
935
936impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
937 type Err = std::convert::Infallible;
938 fn from_str(s: &str) -> Result<Self, Self::Err> {
939 use CreateSetupIntentPaymentMethodDataEpsBank::*;
940 match s {
941 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
942 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
943 "bank_austria" => Ok(BankAustria),
944 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
945 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
946 "bawag_psk_ag" => Ok(BawagPskAg),
947 "bks_bank_ag" => Ok(BksBankAg),
948 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
949 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
950 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
951 "deutsche_bank_ag" => Ok(DeutscheBankAg),
952 "dolomitenbank" => Ok(Dolomitenbank),
953 "easybank_ag" => Ok(EasybankAg),
954 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
955 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
956 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
957 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
958 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
959 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
960 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
961 "marchfelder_bank" => Ok(MarchfelderBank),
962 "oberbank_ag" => Ok(OberbankAg),
963 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
964 "schoellerbank_ag" => Ok(SchoellerbankAg),
965 "sparda_bank_wien" => Ok(SpardaBankWien),
966 "volksbank_gruppe" => Ok(VolksbankGruppe),
967 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
968 "vr_bank_braunau" => Ok(VrBankBraunau),
969 v => {
970 tracing::warn!(
971 "Unknown value '{}' for enum '{}'",
972 v,
973 "CreateSetupIntentPaymentMethodDataEpsBank"
974 );
975 Ok(Unknown(v.to_owned()))
976 }
977 }
978 }
979}
980impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
981 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
982 f.write_str(self.as_str())
983 }
984}
985
986impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
987 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
988 f.write_str(self.as_str())
989 }
990}
991impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
992 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
993 where
994 S: serde::Serializer,
995 {
996 serializer.serialize_str(self.as_str())
997 }
998}
999#[cfg(feature = "deserialize")]
1000impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
1001 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1002 use std::str::FromStr;
1003 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1004 Ok(Self::from_str(&s).expect("infallible"))
1005 }
1006}
1007#[derive(Clone, Debug, serde::Serialize)]
1009pub struct CreateSetupIntentPaymentMethodDataFpx {
1010 #[serde(skip_serializing_if = "Option::is_none")]
1012 pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
1013 pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
1015}
1016impl CreateSetupIntentPaymentMethodDataFpx {
1017 pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
1018 Self { account_holder_type: None, bank: bank.into() }
1019 }
1020}
1021#[derive(Clone, Eq, PartialEq)]
1023#[non_exhaustive]
1024pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1025 Company,
1026 Individual,
1027 Unknown(String),
1029}
1030impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1031 pub fn as_str(&self) -> &str {
1032 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1033 match self {
1034 Company => "company",
1035 Individual => "individual",
1036 Unknown(v) => v,
1037 }
1038 }
1039}
1040
1041impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1042 type Err = std::convert::Infallible;
1043 fn from_str(s: &str) -> Result<Self, Self::Err> {
1044 use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1045 match s {
1046 "company" => Ok(Company),
1047 "individual" => Ok(Individual),
1048 v => {
1049 tracing::warn!(
1050 "Unknown value '{}' for enum '{}'",
1051 v,
1052 "CreateSetupIntentPaymentMethodDataFpxAccountHolderType"
1053 );
1054 Ok(Unknown(v.to_owned()))
1055 }
1056 }
1057 }
1058}
1059impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1060 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1061 f.write_str(self.as_str())
1062 }
1063}
1064
1065impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1066 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1067 f.write_str(self.as_str())
1068 }
1069}
1070impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1071 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1072 where
1073 S: serde::Serializer,
1074 {
1075 serializer.serialize_str(self.as_str())
1076 }
1077}
1078#[cfg(feature = "deserialize")]
1079impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1080 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1081 use std::str::FromStr;
1082 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1083 Ok(Self::from_str(&s).expect("infallible"))
1084 }
1085}
1086#[derive(Clone, Eq, PartialEq)]
1088#[non_exhaustive]
1089pub enum CreateSetupIntentPaymentMethodDataFpxBank {
1090 AffinBank,
1091 Agrobank,
1092 AllianceBank,
1093 Ambank,
1094 BankIslam,
1095 BankMuamalat,
1096 BankOfChina,
1097 BankRakyat,
1098 Bsn,
1099 Cimb,
1100 DeutscheBank,
1101 HongLeongBank,
1102 Hsbc,
1103 Kfh,
1104 Maybank2e,
1105 Maybank2u,
1106 Ocbc,
1107 PbEnterprise,
1108 PublicBank,
1109 Rhb,
1110 StandardChartered,
1111 Uob,
1112 Unknown(String),
1114}
1115impl CreateSetupIntentPaymentMethodDataFpxBank {
1116 pub fn as_str(&self) -> &str {
1117 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1118 match self {
1119 AffinBank => "affin_bank",
1120 Agrobank => "agrobank",
1121 AllianceBank => "alliance_bank",
1122 Ambank => "ambank",
1123 BankIslam => "bank_islam",
1124 BankMuamalat => "bank_muamalat",
1125 BankOfChina => "bank_of_china",
1126 BankRakyat => "bank_rakyat",
1127 Bsn => "bsn",
1128 Cimb => "cimb",
1129 DeutscheBank => "deutsche_bank",
1130 HongLeongBank => "hong_leong_bank",
1131 Hsbc => "hsbc",
1132 Kfh => "kfh",
1133 Maybank2e => "maybank2e",
1134 Maybank2u => "maybank2u",
1135 Ocbc => "ocbc",
1136 PbEnterprise => "pb_enterprise",
1137 PublicBank => "public_bank",
1138 Rhb => "rhb",
1139 StandardChartered => "standard_chartered",
1140 Uob => "uob",
1141 Unknown(v) => v,
1142 }
1143 }
1144}
1145
1146impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
1147 type Err = std::convert::Infallible;
1148 fn from_str(s: &str) -> Result<Self, Self::Err> {
1149 use CreateSetupIntentPaymentMethodDataFpxBank::*;
1150 match s {
1151 "affin_bank" => Ok(AffinBank),
1152 "agrobank" => Ok(Agrobank),
1153 "alliance_bank" => Ok(AllianceBank),
1154 "ambank" => Ok(Ambank),
1155 "bank_islam" => Ok(BankIslam),
1156 "bank_muamalat" => Ok(BankMuamalat),
1157 "bank_of_china" => Ok(BankOfChina),
1158 "bank_rakyat" => Ok(BankRakyat),
1159 "bsn" => Ok(Bsn),
1160 "cimb" => Ok(Cimb),
1161 "deutsche_bank" => Ok(DeutscheBank),
1162 "hong_leong_bank" => Ok(HongLeongBank),
1163 "hsbc" => Ok(Hsbc),
1164 "kfh" => Ok(Kfh),
1165 "maybank2e" => Ok(Maybank2e),
1166 "maybank2u" => Ok(Maybank2u),
1167 "ocbc" => Ok(Ocbc),
1168 "pb_enterprise" => Ok(PbEnterprise),
1169 "public_bank" => Ok(PublicBank),
1170 "rhb" => Ok(Rhb),
1171 "standard_chartered" => Ok(StandardChartered),
1172 "uob" => Ok(Uob),
1173 v => {
1174 tracing::warn!(
1175 "Unknown value '{}' for enum '{}'",
1176 v,
1177 "CreateSetupIntentPaymentMethodDataFpxBank"
1178 );
1179 Ok(Unknown(v.to_owned()))
1180 }
1181 }
1182 }
1183}
1184impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
1185 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1186 f.write_str(self.as_str())
1187 }
1188}
1189
1190impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1191 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1192 f.write_str(self.as_str())
1193 }
1194}
1195impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
1196 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1197 where
1198 S: serde::Serializer,
1199 {
1200 serializer.serialize_str(self.as_str())
1201 }
1202}
1203#[cfg(feature = "deserialize")]
1204impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
1205 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1206 use std::str::FromStr;
1207 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1208 Ok(Self::from_str(&s).expect("infallible"))
1209 }
1210}
1211#[derive(Clone, Debug, serde::Serialize)]
1213pub struct CreateSetupIntentPaymentMethodDataIdeal {
1214 #[serde(skip_serializing_if = "Option::is_none")]
1218 pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
1219}
1220impl CreateSetupIntentPaymentMethodDataIdeal {
1221 pub fn new() -> Self {
1222 Self { bank: None }
1223 }
1224}
1225impl Default for CreateSetupIntentPaymentMethodDataIdeal {
1226 fn default() -> Self {
1227 Self::new()
1228 }
1229}
1230#[derive(Clone, Eq, PartialEq)]
1234#[non_exhaustive]
1235pub enum CreateSetupIntentPaymentMethodDataIdealBank {
1236 AbnAmro,
1237 AsnBank,
1238 Bunq,
1239 Buut,
1240 Finom,
1241 Handelsbanken,
1242 Ing,
1243 Knab,
1244 Moneyou,
1245 N26,
1246 Nn,
1247 Rabobank,
1248 Regiobank,
1249 Revolut,
1250 SnsBank,
1251 TriodosBank,
1252 VanLanschot,
1253 Yoursafe,
1254 Unknown(String),
1256}
1257impl CreateSetupIntentPaymentMethodDataIdealBank {
1258 pub fn as_str(&self) -> &str {
1259 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1260 match self {
1261 AbnAmro => "abn_amro",
1262 AsnBank => "asn_bank",
1263 Bunq => "bunq",
1264 Buut => "buut",
1265 Finom => "finom",
1266 Handelsbanken => "handelsbanken",
1267 Ing => "ing",
1268 Knab => "knab",
1269 Moneyou => "moneyou",
1270 N26 => "n26",
1271 Nn => "nn",
1272 Rabobank => "rabobank",
1273 Regiobank => "regiobank",
1274 Revolut => "revolut",
1275 SnsBank => "sns_bank",
1276 TriodosBank => "triodos_bank",
1277 VanLanschot => "van_lanschot",
1278 Yoursafe => "yoursafe",
1279 Unknown(v) => v,
1280 }
1281 }
1282}
1283
1284impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1285 type Err = std::convert::Infallible;
1286 fn from_str(s: &str) -> Result<Self, Self::Err> {
1287 use CreateSetupIntentPaymentMethodDataIdealBank::*;
1288 match s {
1289 "abn_amro" => Ok(AbnAmro),
1290 "asn_bank" => Ok(AsnBank),
1291 "bunq" => Ok(Bunq),
1292 "buut" => Ok(Buut),
1293 "finom" => Ok(Finom),
1294 "handelsbanken" => Ok(Handelsbanken),
1295 "ing" => Ok(Ing),
1296 "knab" => Ok(Knab),
1297 "moneyou" => Ok(Moneyou),
1298 "n26" => Ok(N26),
1299 "nn" => Ok(Nn),
1300 "rabobank" => Ok(Rabobank),
1301 "regiobank" => Ok(Regiobank),
1302 "revolut" => Ok(Revolut),
1303 "sns_bank" => Ok(SnsBank),
1304 "triodos_bank" => Ok(TriodosBank),
1305 "van_lanschot" => Ok(VanLanschot),
1306 "yoursafe" => Ok(Yoursafe),
1307 v => {
1308 tracing::warn!(
1309 "Unknown value '{}' for enum '{}'",
1310 v,
1311 "CreateSetupIntentPaymentMethodDataIdealBank"
1312 );
1313 Ok(Unknown(v.to_owned()))
1314 }
1315 }
1316 }
1317}
1318impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1319 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1320 f.write_str(self.as_str())
1321 }
1322}
1323
1324impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1325 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1326 f.write_str(self.as_str())
1327 }
1328}
1329impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1330 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1331 where
1332 S: serde::Serializer,
1333 {
1334 serializer.serialize_str(self.as_str())
1335 }
1336}
1337#[cfg(feature = "deserialize")]
1338impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1339 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1340 use std::str::FromStr;
1341 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1342 Ok(Self::from_str(&s).expect("infallible"))
1343 }
1344}
1345#[derive(Copy, Clone, Debug, serde::Serialize)]
1347pub struct CreateSetupIntentPaymentMethodDataKlarna {
1348 #[serde(skip_serializing_if = "Option::is_none")]
1350 pub dob: Option<DateOfBirth>,
1351}
1352impl CreateSetupIntentPaymentMethodDataKlarna {
1353 pub fn new() -> Self {
1354 Self { dob: None }
1355 }
1356}
1357impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1358 fn default() -> Self {
1359 Self::new()
1360 }
1361}
1362#[derive(Clone, Debug, serde::Serialize)]
1364pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1365 #[serde(skip_serializing_if = "Option::is_none")]
1368 pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1369}
1370impl CreateSetupIntentPaymentMethodDataNaverPay {
1371 pub fn new() -> Self {
1372 Self { funding: None }
1373 }
1374}
1375impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1376 fn default() -> Self {
1377 Self::new()
1378 }
1379}
1380#[derive(Clone, Eq, PartialEq)]
1383#[non_exhaustive]
1384pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1385 Card,
1386 Points,
1387 Unknown(String),
1389}
1390impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1391 pub fn as_str(&self) -> &str {
1392 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1393 match self {
1394 Card => "card",
1395 Points => "points",
1396 Unknown(v) => v,
1397 }
1398 }
1399}
1400
1401impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1402 type Err = std::convert::Infallible;
1403 fn from_str(s: &str) -> Result<Self, Self::Err> {
1404 use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1405 match s {
1406 "card" => Ok(Card),
1407 "points" => Ok(Points),
1408 v => {
1409 tracing::warn!(
1410 "Unknown value '{}' for enum '{}'",
1411 v,
1412 "CreateSetupIntentPaymentMethodDataNaverPayFunding"
1413 );
1414 Ok(Unknown(v.to_owned()))
1415 }
1416 }
1417 }
1418}
1419impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1420 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1421 f.write_str(self.as_str())
1422 }
1423}
1424
1425impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1426 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1427 f.write_str(self.as_str())
1428 }
1429}
1430impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1431 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1432 where
1433 S: serde::Serializer,
1434 {
1435 serializer.serialize_str(self.as_str())
1436 }
1437}
1438#[cfg(feature = "deserialize")]
1439impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1440 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1441 use std::str::FromStr;
1442 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1443 Ok(Self::from_str(&s).expect("infallible"))
1444 }
1445}
1446#[derive(Clone, Debug, serde::Serialize)]
1448pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1449 #[serde(skip_serializing_if = "Option::is_none")]
1452 pub account_holder_name: Option<String>,
1453 pub account_number: String,
1455 pub bank_code: String,
1457 pub branch_code: String,
1459 #[serde(skip_serializing_if = "Option::is_none")]
1460 pub reference: Option<String>,
1461 pub suffix: String,
1463}
1464impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1465 pub fn new(
1466 account_number: impl Into<String>,
1467 bank_code: impl Into<String>,
1468 branch_code: impl Into<String>,
1469 suffix: impl Into<String>,
1470 ) -> Self {
1471 Self {
1472 account_holder_name: None,
1473 account_number: account_number.into(),
1474 bank_code: bank_code.into(),
1475 branch_code: branch_code.into(),
1476 reference: None,
1477 suffix: suffix.into(),
1478 }
1479 }
1480}
1481#[derive(Clone, Debug, serde::Serialize)]
1483pub struct CreateSetupIntentPaymentMethodDataP24 {
1484 #[serde(skip_serializing_if = "Option::is_none")]
1486 pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1487}
1488impl CreateSetupIntentPaymentMethodDataP24 {
1489 pub fn new() -> Self {
1490 Self { bank: None }
1491 }
1492}
1493impl Default for CreateSetupIntentPaymentMethodDataP24 {
1494 fn default() -> Self {
1495 Self::new()
1496 }
1497}
1498#[derive(Clone, Eq, PartialEq)]
1500#[non_exhaustive]
1501pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1502 AliorBank,
1503 BankMillennium,
1504 BankNowyBfgSa,
1505 BankPekaoSa,
1506 BankiSpbdzielcze,
1507 Blik,
1508 BnpParibas,
1509 Boz,
1510 CitiHandlowy,
1511 CreditAgricole,
1512 Envelobank,
1513 EtransferPocztowy24,
1514 GetinBank,
1515 Ideabank,
1516 Ing,
1517 Inteligo,
1518 MbankMtransfer,
1519 NestPrzelew,
1520 NoblePay,
1521 PbacZIpko,
1522 PlusBank,
1523 SantanderPrzelew24,
1524 TmobileUsbugiBankowe,
1525 ToyotaBank,
1526 Velobank,
1527 VolkswagenBank,
1528 Unknown(String),
1530}
1531impl CreateSetupIntentPaymentMethodDataP24Bank {
1532 pub fn as_str(&self) -> &str {
1533 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1534 match self {
1535 AliorBank => "alior_bank",
1536 BankMillennium => "bank_millennium",
1537 BankNowyBfgSa => "bank_nowy_bfg_sa",
1538 BankPekaoSa => "bank_pekao_sa",
1539 BankiSpbdzielcze => "banki_spbdzielcze",
1540 Blik => "blik",
1541 BnpParibas => "bnp_paribas",
1542 Boz => "boz",
1543 CitiHandlowy => "citi_handlowy",
1544 CreditAgricole => "credit_agricole",
1545 Envelobank => "envelobank",
1546 EtransferPocztowy24 => "etransfer_pocztowy24",
1547 GetinBank => "getin_bank",
1548 Ideabank => "ideabank",
1549 Ing => "ing",
1550 Inteligo => "inteligo",
1551 MbankMtransfer => "mbank_mtransfer",
1552 NestPrzelew => "nest_przelew",
1553 NoblePay => "noble_pay",
1554 PbacZIpko => "pbac_z_ipko",
1555 PlusBank => "plus_bank",
1556 SantanderPrzelew24 => "santander_przelew24",
1557 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1558 ToyotaBank => "toyota_bank",
1559 Velobank => "velobank",
1560 VolkswagenBank => "volkswagen_bank",
1561 Unknown(v) => v,
1562 }
1563 }
1564}
1565
1566impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1567 type Err = std::convert::Infallible;
1568 fn from_str(s: &str) -> Result<Self, Self::Err> {
1569 use CreateSetupIntentPaymentMethodDataP24Bank::*;
1570 match s {
1571 "alior_bank" => Ok(AliorBank),
1572 "bank_millennium" => Ok(BankMillennium),
1573 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1574 "bank_pekao_sa" => Ok(BankPekaoSa),
1575 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1576 "blik" => Ok(Blik),
1577 "bnp_paribas" => Ok(BnpParibas),
1578 "boz" => Ok(Boz),
1579 "citi_handlowy" => Ok(CitiHandlowy),
1580 "credit_agricole" => Ok(CreditAgricole),
1581 "envelobank" => Ok(Envelobank),
1582 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1583 "getin_bank" => Ok(GetinBank),
1584 "ideabank" => Ok(Ideabank),
1585 "ing" => Ok(Ing),
1586 "inteligo" => Ok(Inteligo),
1587 "mbank_mtransfer" => Ok(MbankMtransfer),
1588 "nest_przelew" => Ok(NestPrzelew),
1589 "noble_pay" => Ok(NoblePay),
1590 "pbac_z_ipko" => Ok(PbacZIpko),
1591 "plus_bank" => Ok(PlusBank),
1592 "santander_przelew24" => Ok(SantanderPrzelew24),
1593 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1594 "toyota_bank" => Ok(ToyotaBank),
1595 "velobank" => Ok(Velobank),
1596 "volkswagen_bank" => Ok(VolkswagenBank),
1597 v => {
1598 tracing::warn!(
1599 "Unknown value '{}' for enum '{}'",
1600 v,
1601 "CreateSetupIntentPaymentMethodDataP24Bank"
1602 );
1603 Ok(Unknown(v.to_owned()))
1604 }
1605 }
1606 }
1607}
1608impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1609 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1610 f.write_str(self.as_str())
1611 }
1612}
1613
1614impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1615 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1616 f.write_str(self.as_str())
1617 }
1618}
1619impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1620 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1621 where
1622 S: serde::Serializer,
1623 {
1624 serializer.serialize_str(self.as_str())
1625 }
1626}
1627#[cfg(feature = "deserialize")]
1628impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1629 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1630 use std::str::FromStr;
1631 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1632 Ok(Self::from_str(&s).expect("infallible"))
1633 }
1634}
1635#[derive(Clone, Debug, serde::Serialize)]
1637pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1638 pub iban: String,
1640}
1641impl CreateSetupIntentPaymentMethodDataSepaDebit {
1642 pub fn new(iban: impl Into<String>) -> Self {
1643 Self { iban: iban.into() }
1644 }
1645}
1646#[derive(Clone, Debug, serde::Serialize)]
1648pub struct CreateSetupIntentPaymentMethodDataSofort {
1649 pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1651}
1652impl CreateSetupIntentPaymentMethodDataSofort {
1653 pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1654 Self { country: country.into() }
1655 }
1656}
1657#[derive(Clone, Eq, PartialEq)]
1659#[non_exhaustive]
1660pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1661 At,
1662 Be,
1663 De,
1664 Es,
1665 It,
1666 Nl,
1667 Unknown(String),
1669}
1670impl CreateSetupIntentPaymentMethodDataSofortCountry {
1671 pub fn as_str(&self) -> &str {
1672 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1673 match self {
1674 At => "AT",
1675 Be => "BE",
1676 De => "DE",
1677 Es => "ES",
1678 It => "IT",
1679 Nl => "NL",
1680 Unknown(v) => v,
1681 }
1682 }
1683}
1684
1685impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1686 type Err = std::convert::Infallible;
1687 fn from_str(s: &str) -> Result<Self, Self::Err> {
1688 use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1689 match s {
1690 "AT" => Ok(At),
1691 "BE" => Ok(Be),
1692 "DE" => Ok(De),
1693 "ES" => Ok(Es),
1694 "IT" => Ok(It),
1695 "NL" => Ok(Nl),
1696 v => {
1697 tracing::warn!(
1698 "Unknown value '{}' for enum '{}'",
1699 v,
1700 "CreateSetupIntentPaymentMethodDataSofortCountry"
1701 );
1702 Ok(Unknown(v.to_owned()))
1703 }
1704 }
1705 }
1706}
1707impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
1708 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1709 f.write_str(self.as_str())
1710 }
1711}
1712
1713impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
1714 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1715 f.write_str(self.as_str())
1716 }
1717}
1718impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
1719 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1720 where
1721 S: serde::Serializer,
1722 {
1723 serializer.serialize_str(self.as_str())
1724 }
1725}
1726#[cfg(feature = "deserialize")]
1727impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
1728 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1729 use std::str::FromStr;
1730 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1731 Ok(Self::from_str(&s).expect("infallible"))
1732 }
1733}
1734#[derive(Clone, Eq, PartialEq)]
1738#[non_exhaustive]
1739pub enum CreateSetupIntentPaymentMethodDataType {
1740 AcssDebit,
1741 Affirm,
1742 AfterpayClearpay,
1743 Alipay,
1744 Alma,
1745 AmazonPay,
1746 AuBecsDebit,
1747 BacsDebit,
1748 Bancontact,
1749 Billie,
1750 Blik,
1751 Boleto,
1752 Cashapp,
1753 Crypto,
1754 CustomerBalance,
1755 Eps,
1756 Fpx,
1757 Giropay,
1758 Grabpay,
1759 Ideal,
1760 KakaoPay,
1761 Klarna,
1762 Konbini,
1763 KrCard,
1764 Link,
1765 MbWay,
1766 Mobilepay,
1767 Multibanco,
1768 NaverPay,
1769 NzBankAccount,
1770 Oxxo,
1771 P24,
1772 PayByBank,
1773 Payco,
1774 Paynow,
1775 Paypal,
1776 Pix,
1777 Promptpay,
1778 RevolutPay,
1779 SamsungPay,
1780 Satispay,
1781 SepaDebit,
1782 Sofort,
1783 Swish,
1784 Twint,
1785 UsBankAccount,
1786 WechatPay,
1787 Zip,
1788 Unknown(String),
1790}
1791impl CreateSetupIntentPaymentMethodDataType {
1792 pub fn as_str(&self) -> &str {
1793 use CreateSetupIntentPaymentMethodDataType::*;
1794 match self {
1795 AcssDebit => "acss_debit",
1796 Affirm => "affirm",
1797 AfterpayClearpay => "afterpay_clearpay",
1798 Alipay => "alipay",
1799 Alma => "alma",
1800 AmazonPay => "amazon_pay",
1801 AuBecsDebit => "au_becs_debit",
1802 BacsDebit => "bacs_debit",
1803 Bancontact => "bancontact",
1804 Billie => "billie",
1805 Blik => "blik",
1806 Boleto => "boleto",
1807 Cashapp => "cashapp",
1808 Crypto => "crypto",
1809 CustomerBalance => "customer_balance",
1810 Eps => "eps",
1811 Fpx => "fpx",
1812 Giropay => "giropay",
1813 Grabpay => "grabpay",
1814 Ideal => "ideal",
1815 KakaoPay => "kakao_pay",
1816 Klarna => "klarna",
1817 Konbini => "konbini",
1818 KrCard => "kr_card",
1819 Link => "link",
1820 MbWay => "mb_way",
1821 Mobilepay => "mobilepay",
1822 Multibanco => "multibanco",
1823 NaverPay => "naver_pay",
1824 NzBankAccount => "nz_bank_account",
1825 Oxxo => "oxxo",
1826 P24 => "p24",
1827 PayByBank => "pay_by_bank",
1828 Payco => "payco",
1829 Paynow => "paynow",
1830 Paypal => "paypal",
1831 Pix => "pix",
1832 Promptpay => "promptpay",
1833 RevolutPay => "revolut_pay",
1834 SamsungPay => "samsung_pay",
1835 Satispay => "satispay",
1836 SepaDebit => "sepa_debit",
1837 Sofort => "sofort",
1838 Swish => "swish",
1839 Twint => "twint",
1840 UsBankAccount => "us_bank_account",
1841 WechatPay => "wechat_pay",
1842 Zip => "zip",
1843 Unknown(v) => v,
1844 }
1845 }
1846}
1847
1848impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
1849 type Err = std::convert::Infallible;
1850 fn from_str(s: &str) -> Result<Self, Self::Err> {
1851 use CreateSetupIntentPaymentMethodDataType::*;
1852 match s {
1853 "acss_debit" => Ok(AcssDebit),
1854 "affirm" => Ok(Affirm),
1855 "afterpay_clearpay" => Ok(AfterpayClearpay),
1856 "alipay" => Ok(Alipay),
1857 "alma" => Ok(Alma),
1858 "amazon_pay" => Ok(AmazonPay),
1859 "au_becs_debit" => Ok(AuBecsDebit),
1860 "bacs_debit" => Ok(BacsDebit),
1861 "bancontact" => Ok(Bancontact),
1862 "billie" => Ok(Billie),
1863 "blik" => Ok(Blik),
1864 "boleto" => Ok(Boleto),
1865 "cashapp" => Ok(Cashapp),
1866 "crypto" => Ok(Crypto),
1867 "customer_balance" => Ok(CustomerBalance),
1868 "eps" => Ok(Eps),
1869 "fpx" => Ok(Fpx),
1870 "giropay" => Ok(Giropay),
1871 "grabpay" => Ok(Grabpay),
1872 "ideal" => Ok(Ideal),
1873 "kakao_pay" => Ok(KakaoPay),
1874 "klarna" => Ok(Klarna),
1875 "konbini" => Ok(Konbini),
1876 "kr_card" => Ok(KrCard),
1877 "link" => Ok(Link),
1878 "mb_way" => Ok(MbWay),
1879 "mobilepay" => Ok(Mobilepay),
1880 "multibanco" => Ok(Multibanco),
1881 "naver_pay" => Ok(NaverPay),
1882 "nz_bank_account" => Ok(NzBankAccount),
1883 "oxxo" => Ok(Oxxo),
1884 "p24" => Ok(P24),
1885 "pay_by_bank" => Ok(PayByBank),
1886 "payco" => Ok(Payco),
1887 "paynow" => Ok(Paynow),
1888 "paypal" => Ok(Paypal),
1889 "pix" => Ok(Pix),
1890 "promptpay" => Ok(Promptpay),
1891 "revolut_pay" => Ok(RevolutPay),
1892 "samsung_pay" => Ok(SamsungPay),
1893 "satispay" => Ok(Satispay),
1894 "sepa_debit" => Ok(SepaDebit),
1895 "sofort" => Ok(Sofort),
1896 "swish" => Ok(Swish),
1897 "twint" => Ok(Twint),
1898 "us_bank_account" => Ok(UsBankAccount),
1899 "wechat_pay" => Ok(WechatPay),
1900 "zip" => Ok(Zip),
1901 v => {
1902 tracing::warn!(
1903 "Unknown value '{}' for enum '{}'",
1904 v,
1905 "CreateSetupIntentPaymentMethodDataType"
1906 );
1907 Ok(Unknown(v.to_owned()))
1908 }
1909 }
1910 }
1911}
1912impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
1913 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1914 f.write_str(self.as_str())
1915 }
1916}
1917
1918impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
1919 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1920 f.write_str(self.as_str())
1921 }
1922}
1923impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
1924 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1925 where
1926 S: serde::Serializer,
1927 {
1928 serializer.serialize_str(self.as_str())
1929 }
1930}
1931#[cfg(feature = "deserialize")]
1932impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
1933 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1934 use std::str::FromStr;
1935 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1936 Ok(Self::from_str(&s).expect("infallible"))
1937 }
1938}
1939#[derive(Clone, Debug, serde::Serialize)]
1941pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
1942 #[serde(skip_serializing_if = "Option::is_none")]
1944 pub account_holder_type:
1945 Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
1946 #[serde(skip_serializing_if = "Option::is_none")]
1948 pub account_number: Option<String>,
1949 #[serde(skip_serializing_if = "Option::is_none")]
1951 pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
1952 #[serde(skip_serializing_if = "Option::is_none")]
1954 pub financial_connections_account: Option<String>,
1955 #[serde(skip_serializing_if = "Option::is_none")]
1957 pub routing_number: Option<String>,
1958}
1959impl CreateSetupIntentPaymentMethodDataUsBankAccount {
1960 pub fn new() -> Self {
1961 Self {
1962 account_holder_type: None,
1963 account_number: None,
1964 account_type: None,
1965 financial_connections_account: None,
1966 routing_number: None,
1967 }
1968 }
1969}
1970impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
1971 fn default() -> Self {
1972 Self::new()
1973 }
1974}
1975#[derive(Clone, Eq, PartialEq)]
1977#[non_exhaustive]
1978pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1979 Company,
1980 Individual,
1981 Unknown(String),
1983}
1984impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1985 pub fn as_str(&self) -> &str {
1986 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1987 match self {
1988 Company => "company",
1989 Individual => "individual",
1990 Unknown(v) => v,
1991 }
1992 }
1993}
1994
1995impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1996 type Err = std::convert::Infallible;
1997 fn from_str(s: &str) -> Result<Self, Self::Err> {
1998 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1999 match s {
2000 "company" => Ok(Company),
2001 "individual" => Ok(Individual),
2002 v => {
2003 tracing::warn!(
2004 "Unknown value '{}' for enum '{}'",
2005 v,
2006 "CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
2007 );
2008 Ok(Unknown(v.to_owned()))
2009 }
2010 }
2011 }
2012}
2013impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2014 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2015 f.write_str(self.as_str())
2016 }
2017}
2018
2019impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2020 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2021 f.write_str(self.as_str())
2022 }
2023}
2024impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2025 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2026 where
2027 S: serde::Serializer,
2028 {
2029 serializer.serialize_str(self.as_str())
2030 }
2031}
2032#[cfg(feature = "deserialize")]
2033impl<'de> serde::Deserialize<'de>
2034 for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
2035{
2036 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2037 use std::str::FromStr;
2038 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2039 Ok(Self::from_str(&s).expect("infallible"))
2040 }
2041}
2042#[derive(Clone, Eq, PartialEq)]
2044#[non_exhaustive]
2045pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2046 Checking,
2047 Savings,
2048 Unknown(String),
2050}
2051impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2052 pub fn as_str(&self) -> &str {
2053 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2054 match self {
2055 Checking => "checking",
2056 Savings => "savings",
2057 Unknown(v) => v,
2058 }
2059 }
2060}
2061
2062impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2063 type Err = std::convert::Infallible;
2064 fn from_str(s: &str) -> Result<Self, Self::Err> {
2065 use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2066 match s {
2067 "checking" => Ok(Checking),
2068 "savings" => Ok(Savings),
2069 v => {
2070 tracing::warn!(
2071 "Unknown value '{}' for enum '{}'",
2072 v,
2073 "CreateSetupIntentPaymentMethodDataUsBankAccountAccountType"
2074 );
2075 Ok(Unknown(v.to_owned()))
2076 }
2077 }
2078 }
2079}
2080impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2081 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2082 f.write_str(self.as_str())
2083 }
2084}
2085
2086impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2087 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2088 f.write_str(self.as_str())
2089 }
2090}
2091impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2092 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2093 where
2094 S: serde::Serializer,
2095 {
2096 serializer.serialize_str(self.as_str())
2097 }
2098}
2099#[cfg(feature = "deserialize")]
2100impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2101 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2102 use std::str::FromStr;
2103 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2104 Ok(Self::from_str(&s).expect("infallible"))
2105 }
2106}
2107#[derive(Clone, Debug, serde::Serialize)]
2109pub struct CreateSetupIntentPaymentMethodOptions {
2110 #[serde(skip_serializing_if = "Option::is_none")]
2112 pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2113 #[serde(skip_serializing_if = "Option::is_none")]
2115 #[serde(with = "stripe_types::with_serde_json_opt")]
2116 pub amazon_pay: Option<miniserde::json::Value>,
2117 #[serde(skip_serializing_if = "Option::is_none")]
2119 pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2120 #[serde(skip_serializing_if = "Option::is_none")]
2122 pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2123 #[serde(skip_serializing_if = "Option::is_none")]
2125 #[serde(with = "stripe_types::with_serde_json_opt")]
2126 pub card_present: Option<miniserde::json::Value>,
2127 #[serde(skip_serializing_if = "Option::is_none")]
2129 pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2130 #[serde(skip_serializing_if = "Option::is_none")]
2132 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2133 #[serde(skip_serializing_if = "Option::is_none")]
2135 pub paypal: Option<PaymentMethodOptionsParam>,
2136 #[serde(skip_serializing_if = "Option::is_none")]
2138 pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2139 #[serde(skip_serializing_if = "Option::is_none")]
2141 pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2142}
2143impl CreateSetupIntentPaymentMethodOptions {
2144 pub fn new() -> Self {
2145 Self {
2146 acss_debit: None,
2147 amazon_pay: None,
2148 bacs_debit: None,
2149 card: None,
2150 card_present: None,
2151 klarna: None,
2152 link: None,
2153 paypal: None,
2154 sepa_debit: None,
2155 us_bank_account: None,
2156 }
2157 }
2158}
2159impl Default for CreateSetupIntentPaymentMethodOptions {
2160 fn default() -> Self {
2161 Self::new()
2162 }
2163}
2164#[derive(Clone, Debug, serde::Serialize)]
2166pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2167 #[serde(skip_serializing_if = "Option::is_none")]
2170 pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2171 #[serde(skip_serializing_if = "Option::is_none")]
2173 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2174 #[serde(skip_serializing_if = "Option::is_none")]
2176 pub verification_method:
2177 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2178}
2179impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2180 pub fn new() -> Self {
2181 Self { currency: None, mandate_options: None, verification_method: None }
2182 }
2183}
2184impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2185 fn default() -> Self {
2186 Self::new()
2187 }
2188}
2189#[derive(Clone, Eq, PartialEq)]
2192#[non_exhaustive]
2193pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2194 Cad,
2195 Usd,
2196 Unknown(String),
2198}
2199impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2200 pub fn as_str(&self) -> &str {
2201 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2202 match self {
2203 Cad => "cad",
2204 Usd => "usd",
2205 Unknown(v) => v,
2206 }
2207 }
2208}
2209
2210impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2211 type Err = std::convert::Infallible;
2212 fn from_str(s: &str) -> Result<Self, Self::Err> {
2213 use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2214 match s {
2215 "cad" => Ok(Cad),
2216 "usd" => Ok(Usd),
2217 v => {
2218 tracing::warn!(
2219 "Unknown value '{}' for enum '{}'",
2220 v,
2221 "CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
2222 );
2223 Ok(Unknown(v.to_owned()))
2224 }
2225 }
2226 }
2227}
2228impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2229 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2230 f.write_str(self.as_str())
2231 }
2232}
2233
2234impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2235 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2236 f.write_str(self.as_str())
2237 }
2238}
2239impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2240 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2241 where
2242 S: serde::Serializer,
2243 {
2244 serializer.serialize_str(self.as_str())
2245 }
2246}
2247#[cfg(feature = "deserialize")]
2248impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2249 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2250 use std::str::FromStr;
2251 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2252 Ok(Self::from_str(&s).expect("infallible"))
2253 }
2254}
2255#[derive(Clone, Debug, serde::Serialize)]
2257pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2258 #[serde(skip_serializing_if = "Option::is_none")]
2262 pub custom_mandate_url: Option<String>,
2263 #[serde(skip_serializing_if = "Option::is_none")]
2265 pub default_for:
2266 Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2267 #[serde(skip_serializing_if = "Option::is_none")]
2270 pub interval_description: Option<String>,
2271 #[serde(skip_serializing_if = "Option::is_none")]
2273 pub payment_schedule:
2274 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2275 #[serde(skip_serializing_if = "Option::is_none")]
2277 pub transaction_type:
2278 Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2279}
2280impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2281 pub fn new() -> Self {
2282 Self {
2283 custom_mandate_url: None,
2284 default_for: None,
2285 interval_description: None,
2286 payment_schedule: None,
2287 transaction_type: None,
2288 }
2289 }
2290}
2291impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2292 fn default() -> Self {
2293 Self::new()
2294 }
2295}
2296#[derive(Clone, Eq, PartialEq)]
2298#[non_exhaustive]
2299pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2300 Invoice,
2301 Subscription,
2302 Unknown(String),
2304}
2305impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2306 pub fn as_str(&self) -> &str {
2307 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2308 match self {
2309 Invoice => "invoice",
2310 Subscription => "subscription",
2311 Unknown(v) => v,
2312 }
2313 }
2314}
2315
2316impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2317 type Err = std::convert::Infallible;
2318 fn from_str(s: &str) -> Result<Self, Self::Err> {
2319 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2320 match s {
2321 "invoice" => Ok(Invoice),
2322 "subscription" => Ok(Subscription),
2323 v => {
2324 tracing::warn!(
2325 "Unknown value '{}' for enum '{}'",
2326 v,
2327 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
2328 );
2329 Ok(Unknown(v.to_owned()))
2330 }
2331 }
2332 }
2333}
2334impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2335 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2336 f.write_str(self.as_str())
2337 }
2338}
2339
2340impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2341 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2342 f.write_str(self.as_str())
2343 }
2344}
2345impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2346 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2347 where
2348 S: serde::Serializer,
2349 {
2350 serializer.serialize_str(self.as_str())
2351 }
2352}
2353#[cfg(feature = "deserialize")]
2354impl<'de> serde::Deserialize<'de>
2355 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2356{
2357 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2358 use std::str::FromStr;
2359 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2360 Ok(Self::from_str(&s).expect("infallible"))
2361 }
2362}
2363#[derive(Clone, Eq, PartialEq)]
2365#[non_exhaustive]
2366pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2367 Combined,
2368 Interval,
2369 Sporadic,
2370 Unknown(String),
2372}
2373impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2374 pub fn as_str(&self) -> &str {
2375 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2376 match self {
2377 Combined => "combined",
2378 Interval => "interval",
2379 Sporadic => "sporadic",
2380 Unknown(v) => v,
2381 }
2382 }
2383}
2384
2385impl std::str::FromStr
2386 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2387{
2388 type Err = std::convert::Infallible;
2389 fn from_str(s: &str) -> Result<Self, Self::Err> {
2390 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2391 match s {
2392 "combined" => Ok(Combined),
2393 "interval" => Ok(Interval),
2394 "sporadic" => Ok(Sporadic),
2395 v => {
2396 tracing::warn!(
2397 "Unknown value '{}' for enum '{}'",
2398 v,
2399 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
2400 );
2401 Ok(Unknown(v.to_owned()))
2402 }
2403 }
2404 }
2405}
2406impl std::fmt::Display
2407 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2408{
2409 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2410 f.write_str(self.as_str())
2411 }
2412}
2413
2414impl std::fmt::Debug
2415 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2416{
2417 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2418 f.write_str(self.as_str())
2419 }
2420}
2421impl serde::Serialize
2422 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2423{
2424 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2425 where
2426 S: serde::Serializer,
2427 {
2428 serializer.serialize_str(self.as_str())
2429 }
2430}
2431#[cfg(feature = "deserialize")]
2432impl<'de> serde::Deserialize<'de>
2433 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2434{
2435 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2436 use std::str::FromStr;
2437 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2438 Ok(Self::from_str(&s).expect("infallible"))
2439 }
2440}
2441#[derive(Clone, Eq, PartialEq)]
2443#[non_exhaustive]
2444pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2445 Business,
2446 Personal,
2447 Unknown(String),
2449}
2450impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2451 pub fn as_str(&self) -> &str {
2452 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2453 match self {
2454 Business => "business",
2455 Personal => "personal",
2456 Unknown(v) => v,
2457 }
2458 }
2459}
2460
2461impl std::str::FromStr
2462 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2463{
2464 type Err = std::convert::Infallible;
2465 fn from_str(s: &str) -> Result<Self, Self::Err> {
2466 use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2467 match s {
2468 "business" => Ok(Business),
2469 "personal" => Ok(Personal),
2470 v => {
2471 tracing::warn!(
2472 "Unknown value '{}' for enum '{}'",
2473 v,
2474 "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
2475 );
2476 Ok(Unknown(v.to_owned()))
2477 }
2478 }
2479 }
2480}
2481impl std::fmt::Display
2482 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2483{
2484 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2485 f.write_str(self.as_str())
2486 }
2487}
2488
2489impl std::fmt::Debug
2490 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2491{
2492 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2493 f.write_str(self.as_str())
2494 }
2495}
2496impl serde::Serialize
2497 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2498{
2499 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2500 where
2501 S: serde::Serializer,
2502 {
2503 serializer.serialize_str(self.as_str())
2504 }
2505}
2506#[cfg(feature = "deserialize")]
2507impl<'de> serde::Deserialize<'de>
2508 for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2509{
2510 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2511 use std::str::FromStr;
2512 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2513 Ok(Self::from_str(&s).expect("infallible"))
2514 }
2515}
2516#[derive(Clone, Eq, PartialEq)]
2518#[non_exhaustive]
2519pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2520 Automatic,
2521 Instant,
2522 Microdeposits,
2523 Unknown(String),
2525}
2526impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2527 pub fn as_str(&self) -> &str {
2528 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2529 match self {
2530 Automatic => "automatic",
2531 Instant => "instant",
2532 Microdeposits => "microdeposits",
2533 Unknown(v) => v,
2534 }
2535 }
2536}
2537
2538impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2539 type Err = std::convert::Infallible;
2540 fn from_str(s: &str) -> Result<Self, Self::Err> {
2541 use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2542 match s {
2543 "automatic" => Ok(Automatic),
2544 "instant" => Ok(Instant),
2545 "microdeposits" => Ok(Microdeposits),
2546 v => {
2547 tracing::warn!(
2548 "Unknown value '{}' for enum '{}'",
2549 v,
2550 "CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
2551 );
2552 Ok(Unknown(v.to_owned()))
2553 }
2554 }
2555 }
2556}
2557impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2558 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2559 f.write_str(self.as_str())
2560 }
2561}
2562
2563impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2564 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2565 f.write_str(self.as_str())
2566 }
2567}
2568impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2569 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2570 where
2571 S: serde::Serializer,
2572 {
2573 serializer.serialize_str(self.as_str())
2574 }
2575}
2576#[cfg(feature = "deserialize")]
2577impl<'de> serde::Deserialize<'de>
2578 for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
2579{
2580 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2581 use std::str::FromStr;
2582 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2583 Ok(Self::from_str(&s).expect("infallible"))
2584 }
2585}
2586#[derive(Clone, Debug, serde::Serialize)]
2588pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
2589 #[serde(skip_serializing_if = "Option::is_none")]
2591 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
2592}
2593impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
2594 pub fn new() -> Self {
2595 Self { mandate_options: None }
2596 }
2597}
2598impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
2599 fn default() -> Self {
2600 Self::new()
2601 }
2602}
2603#[derive(Clone, Debug, serde::Serialize)]
2605pub struct CreateSetupIntentPaymentMethodOptionsCard {
2606 #[serde(skip_serializing_if = "Option::is_none")]
2608 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
2609 #[serde(skip_serializing_if = "Option::is_none")]
2613 pub moto: Option<bool>,
2614 #[serde(skip_serializing_if = "Option::is_none")]
2618 pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
2619 #[serde(skip_serializing_if = "Option::is_none")]
2624 pub request_three_d_secure:
2625 Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
2626 #[serde(skip_serializing_if = "Option::is_none")]
2629 pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
2630}
2631impl CreateSetupIntentPaymentMethodOptionsCard {
2632 pub fn new() -> Self {
2633 Self {
2634 mandate_options: None,
2635 moto: None,
2636 network: None,
2637 request_three_d_secure: None,
2638 three_d_secure: None,
2639 }
2640 }
2641}
2642impl Default for CreateSetupIntentPaymentMethodOptionsCard {
2643 fn default() -> Self {
2644 Self::new()
2645 }
2646}
2647#[derive(Clone, Debug, serde::Serialize)]
2649pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2650 pub amount: i64,
2652 pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
2656 pub currency: stripe_types::Currency,
2660 #[serde(skip_serializing_if = "Option::is_none")]
2662 pub description: Option<String>,
2663 #[serde(skip_serializing_if = "Option::is_none")]
2667 pub end_date: Option<stripe_types::Timestamp>,
2668 pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
2670 #[serde(skip_serializing_if = "Option::is_none")]
2675 pub interval_count: Option<u64>,
2676 pub reference: String,
2678 pub start_date: stripe_types::Timestamp,
2680 #[serde(skip_serializing_if = "Option::is_none")]
2682 pub supported_types:
2683 Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
2684}
2685impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2686 pub fn new(
2687 amount: impl Into<i64>,
2688 amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
2689 currency: impl Into<stripe_types::Currency>,
2690 interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
2691 reference: impl Into<String>,
2692 start_date: impl Into<stripe_types::Timestamp>,
2693 ) -> Self {
2694 Self {
2695 amount: amount.into(),
2696 amount_type: amount_type.into(),
2697 currency: currency.into(),
2698 description: None,
2699 end_date: None,
2700 interval: interval.into(),
2701 interval_count: None,
2702 reference: reference.into(),
2703 start_date: start_date.into(),
2704 supported_types: None,
2705 }
2706 }
2707}
2708#[derive(Clone, Eq, PartialEq)]
2712#[non_exhaustive]
2713pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2714 Fixed,
2715 Maximum,
2716 Unknown(String),
2718}
2719impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2720 pub fn as_str(&self) -> &str {
2721 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2722 match self {
2723 Fixed => "fixed",
2724 Maximum => "maximum",
2725 Unknown(v) => v,
2726 }
2727 }
2728}
2729
2730impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2731 type Err = std::convert::Infallible;
2732 fn from_str(s: &str) -> Result<Self, Self::Err> {
2733 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2734 match s {
2735 "fixed" => Ok(Fixed),
2736 "maximum" => Ok(Maximum),
2737 v => {
2738 tracing::warn!(
2739 "Unknown value '{}' for enum '{}'",
2740 v,
2741 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
2742 );
2743 Ok(Unknown(v.to_owned()))
2744 }
2745 }
2746 }
2747}
2748impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2749 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2750 f.write_str(self.as_str())
2751 }
2752}
2753
2754impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2755 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2756 f.write_str(self.as_str())
2757 }
2758}
2759impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2760 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2761 where
2762 S: serde::Serializer,
2763 {
2764 serializer.serialize_str(self.as_str())
2765 }
2766}
2767#[cfg(feature = "deserialize")]
2768impl<'de> serde::Deserialize<'de>
2769 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
2770{
2771 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2772 use std::str::FromStr;
2773 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2774 Ok(Self::from_str(&s).expect("infallible"))
2775 }
2776}
2777#[derive(Clone, Eq, PartialEq)]
2779#[non_exhaustive]
2780pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2781 Day,
2782 Month,
2783 Sporadic,
2784 Week,
2785 Year,
2786 Unknown(String),
2788}
2789impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2790 pub fn as_str(&self) -> &str {
2791 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2792 match self {
2793 Day => "day",
2794 Month => "month",
2795 Sporadic => "sporadic",
2796 Week => "week",
2797 Year => "year",
2798 Unknown(v) => v,
2799 }
2800 }
2801}
2802
2803impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2804 type Err = std::convert::Infallible;
2805 fn from_str(s: &str) -> Result<Self, Self::Err> {
2806 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2807 match s {
2808 "day" => Ok(Day),
2809 "month" => Ok(Month),
2810 "sporadic" => Ok(Sporadic),
2811 "week" => Ok(Week),
2812 "year" => Ok(Year),
2813 v => {
2814 tracing::warn!(
2815 "Unknown value '{}' for enum '{}'",
2816 v,
2817 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
2818 );
2819 Ok(Unknown(v.to_owned()))
2820 }
2821 }
2822 }
2823}
2824impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2825 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2826 f.write_str(self.as_str())
2827 }
2828}
2829
2830impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2831 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2832 f.write_str(self.as_str())
2833 }
2834}
2835impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2836 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2837 where
2838 S: serde::Serializer,
2839 {
2840 serializer.serialize_str(self.as_str())
2841 }
2842}
2843#[cfg(feature = "deserialize")]
2844impl<'de> serde::Deserialize<'de>
2845 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
2846{
2847 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2848 use std::str::FromStr;
2849 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2850 Ok(Self::from_str(&s).expect("infallible"))
2851 }
2852}
2853#[derive(Clone, Eq, PartialEq)]
2855#[non_exhaustive]
2856pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2857 India,
2858 Unknown(String),
2860}
2861impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2862 pub fn as_str(&self) -> &str {
2863 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2864 match self {
2865 India => "india",
2866 Unknown(v) => v,
2867 }
2868 }
2869}
2870
2871impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2872 type Err = std::convert::Infallible;
2873 fn from_str(s: &str) -> Result<Self, Self::Err> {
2874 use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2875 match s {
2876 "india" => Ok(India),
2877 v => {
2878 tracing::warn!(
2879 "Unknown value '{}' for enum '{}'",
2880 v,
2881 "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
2882 );
2883 Ok(Unknown(v.to_owned()))
2884 }
2885 }
2886 }
2887}
2888impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2889 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2890 f.write_str(self.as_str())
2891 }
2892}
2893
2894impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2895 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2896 f.write_str(self.as_str())
2897 }
2898}
2899impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2900 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2901 where
2902 S: serde::Serializer,
2903 {
2904 serializer.serialize_str(self.as_str())
2905 }
2906}
2907#[cfg(feature = "deserialize")]
2908impl<'de> serde::Deserialize<'de>
2909 for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
2910{
2911 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2912 use std::str::FromStr;
2913 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2914 Ok(Self::from_str(&s).expect("infallible"))
2915 }
2916}
2917#[derive(Clone, Eq, PartialEq)]
2921#[non_exhaustive]
2922pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
2923 Amex,
2924 CartesBancaires,
2925 Diners,
2926 Discover,
2927 EftposAu,
2928 Girocard,
2929 Interac,
2930 Jcb,
2931 Link,
2932 Mastercard,
2933 Unionpay,
2934 Unknown,
2935 Visa,
2936 _Unknown(String),
2939}
2940impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
2941 pub fn as_str(&self) -> &str {
2942 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2943 match self {
2944 Amex => "amex",
2945 CartesBancaires => "cartes_bancaires",
2946 Diners => "diners",
2947 Discover => "discover",
2948 EftposAu => "eftpos_au",
2949 Girocard => "girocard",
2950 Interac => "interac",
2951 Jcb => "jcb",
2952 Link => "link",
2953 Mastercard => "mastercard",
2954 Unionpay => "unionpay",
2955 Unknown => "unknown",
2956 Visa => "visa",
2957 _Unknown(v) => v,
2958 }
2959 }
2960}
2961
2962impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2963 type Err = std::convert::Infallible;
2964 fn from_str(s: &str) -> Result<Self, Self::Err> {
2965 use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2966 match s {
2967 "amex" => Ok(Amex),
2968 "cartes_bancaires" => Ok(CartesBancaires),
2969 "diners" => Ok(Diners),
2970 "discover" => Ok(Discover),
2971 "eftpos_au" => Ok(EftposAu),
2972 "girocard" => Ok(Girocard),
2973 "interac" => Ok(Interac),
2974 "jcb" => Ok(Jcb),
2975 "link" => Ok(Link),
2976 "mastercard" => Ok(Mastercard),
2977 "unionpay" => Ok(Unionpay),
2978 "unknown" => Ok(Unknown),
2979 "visa" => Ok(Visa),
2980 v => {
2981 tracing::warn!(
2982 "Unknown value '{}' for enum '{}'",
2983 v,
2984 "CreateSetupIntentPaymentMethodOptionsCardNetwork"
2985 );
2986 Ok(_Unknown(v.to_owned()))
2987 }
2988 }
2989 }
2990}
2991impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2992 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2993 f.write_str(self.as_str())
2994 }
2995}
2996
2997impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2998 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2999 f.write_str(self.as_str())
3000 }
3001}
3002impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3003 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3004 where
3005 S: serde::Serializer,
3006 {
3007 serializer.serialize_str(self.as_str())
3008 }
3009}
3010#[cfg(feature = "deserialize")]
3011impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
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 Ok(Self::from_str(&s).expect("infallible"))
3016 }
3017}
3018#[derive(Clone, Eq, PartialEq)]
3023#[non_exhaustive]
3024pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3025 Any,
3026 Automatic,
3027 Challenge,
3028 Unknown(String),
3030}
3031impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3032 pub fn as_str(&self) -> &str {
3033 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3034 match self {
3035 Any => "any",
3036 Automatic => "automatic",
3037 Challenge => "challenge",
3038 Unknown(v) => v,
3039 }
3040 }
3041}
3042
3043impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3044 type Err = std::convert::Infallible;
3045 fn from_str(s: &str) -> Result<Self, Self::Err> {
3046 use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3047 match s {
3048 "any" => Ok(Any),
3049 "automatic" => Ok(Automatic),
3050 "challenge" => Ok(Challenge),
3051 v => {
3052 tracing::warn!(
3053 "Unknown value '{}' for enum '{}'",
3054 v,
3055 "CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
3056 );
3057 Ok(Unknown(v.to_owned()))
3058 }
3059 }
3060 }
3061}
3062impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3063 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3064 f.write_str(self.as_str())
3065 }
3066}
3067
3068impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3069 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3070 f.write_str(self.as_str())
3071 }
3072}
3073impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3074 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3075 where
3076 S: serde::Serializer,
3077 {
3078 serializer.serialize_str(self.as_str())
3079 }
3080}
3081#[cfg(feature = "deserialize")]
3082impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3083 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3084 use std::str::FromStr;
3085 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3086 Ok(Self::from_str(&s).expect("infallible"))
3087 }
3088}
3089#[derive(Clone, Debug, serde::Serialize)]
3092pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3093 #[serde(skip_serializing_if = "Option::is_none")]
3095 pub ares_trans_status:
3096 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
3097 #[serde(skip_serializing_if = "Option::is_none")]
3102 pub cryptogram: Option<String>,
3103 #[serde(skip_serializing_if = "Option::is_none")]
3106 pub electronic_commerce_indicator:
3107 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
3108 #[serde(skip_serializing_if = "Option::is_none")]
3112 pub network_options:
3113 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
3114 #[serde(skip_serializing_if = "Option::is_none")]
3117 pub requestor_challenge_indicator: Option<String>,
3118 #[serde(skip_serializing_if = "Option::is_none")]
3121 pub transaction_id: Option<String>,
3122 #[serde(skip_serializing_if = "Option::is_none")]
3124 pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
3125}
3126impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3127 pub fn new() -> Self {
3128 Self {
3129 ares_trans_status: None,
3130 cryptogram: None,
3131 electronic_commerce_indicator: None,
3132 network_options: None,
3133 requestor_challenge_indicator: None,
3134 transaction_id: None,
3135 version: None,
3136 }
3137 }
3138}
3139impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3140 fn default() -> Self {
3141 Self::new()
3142 }
3143}
3144#[derive(Clone, Eq, PartialEq)]
3146#[non_exhaustive]
3147pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3148 A,
3149 C,
3150 I,
3151 N,
3152 R,
3153 U,
3154 Y,
3155 Unknown(String),
3157}
3158impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3159 pub fn as_str(&self) -> &str {
3160 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3161 match self {
3162 A => "A",
3163 C => "C",
3164 I => "I",
3165 N => "N",
3166 R => "R",
3167 U => "U",
3168 Y => "Y",
3169 Unknown(v) => v,
3170 }
3171 }
3172}
3173
3174impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3175 type Err = std::convert::Infallible;
3176 fn from_str(s: &str) -> Result<Self, Self::Err> {
3177 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3178 match s {
3179 "A" => Ok(A),
3180 "C" => Ok(C),
3181 "I" => Ok(I),
3182 "N" => Ok(N),
3183 "R" => Ok(R),
3184 "U" => Ok(U),
3185 "Y" => Ok(Y),
3186 v => {
3187 tracing::warn!(
3188 "Unknown value '{}' for enum '{}'",
3189 v,
3190 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
3191 );
3192 Ok(Unknown(v.to_owned()))
3193 }
3194 }
3195 }
3196}
3197impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3198 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3199 f.write_str(self.as_str())
3200 }
3201}
3202
3203impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3204 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3205 f.write_str(self.as_str())
3206 }
3207}
3208impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3209 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3210 where
3211 S: serde::Serializer,
3212 {
3213 serializer.serialize_str(self.as_str())
3214 }
3215}
3216#[cfg(feature = "deserialize")]
3217impl<'de> serde::Deserialize<'de>
3218 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3219{
3220 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3221 use std::str::FromStr;
3222 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3223 Ok(Self::from_str(&s).expect("infallible"))
3224 }
3225}
3226#[derive(Clone, Eq, PartialEq)]
3229#[non_exhaustive]
3230pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3231 V01,
3232 V02,
3233 V05,
3234 V06,
3235 V07,
3236 Unknown(String),
3238}
3239impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3240 pub fn as_str(&self) -> &str {
3241 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3242 match self {
3243 V01 => "01",
3244 V02 => "02",
3245 V05 => "05",
3246 V06 => "06",
3247 V07 => "07",
3248 Unknown(v) => v,
3249 }
3250 }
3251}
3252
3253impl std::str::FromStr
3254 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3255{
3256 type Err = std::convert::Infallible;
3257 fn from_str(s: &str) -> Result<Self, Self::Err> {
3258 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3259 match s {
3260 "01" => Ok(V01),
3261 "02" => Ok(V02),
3262 "05" => Ok(V05),
3263 "06" => Ok(V06),
3264 "07" => Ok(V07),
3265 v => {
3266 tracing::warn!(
3267 "Unknown value '{}' for enum '{}'",
3268 v,
3269 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
3270 );
3271 Ok(Unknown(v.to_owned()))
3272 }
3273 }
3274 }
3275}
3276impl std::fmt::Display
3277 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3278{
3279 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3280 f.write_str(self.as_str())
3281 }
3282}
3283
3284impl std::fmt::Debug
3285 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3286{
3287 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3288 f.write_str(self.as_str())
3289 }
3290}
3291impl serde::Serialize
3292 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3293{
3294 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3295 where
3296 S: serde::Serializer,
3297 {
3298 serializer.serialize_str(self.as_str())
3299 }
3300}
3301#[cfg(feature = "deserialize")]
3302impl<'de> serde::Deserialize<'de>
3303 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3304{
3305 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3306 use std::str::FromStr;
3307 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3308 Ok(Self::from_str(&s).expect("infallible"))
3309 }
3310}
3311#[derive(Clone, Debug, serde::Serialize)]
3315pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3316 #[serde(skip_serializing_if = "Option::is_none")]
3318 pub cartes_bancaires:
3319 Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3320}
3321impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3322 pub fn new() -> Self {
3323 Self { cartes_bancaires: None }
3324 }
3325}
3326impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3327 fn default() -> Self {
3328 Self::new()
3329 }
3330}
3331#[derive(Clone, Debug, serde::Serialize)]
3333pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3334 pub cb_avalgo:
3338 CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
3339 #[serde(skip_serializing_if = "Option::is_none")]
3344 pub cb_exemption: Option<String>,
3345 #[serde(skip_serializing_if = "Option::is_none")]
3348 pub cb_score: Option<i64>,
3349}
3350impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3351 pub fn new(
3352 cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
3353 ) -> Self {
3354 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
3355 }
3356}
3357#[derive(Clone, Eq, PartialEq)]
3361#[non_exhaustive]
3362pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3363{
3364 V0,
3365 V1,
3366 V2,
3367 V3,
3368 V4,
3369 A,
3370 Unknown(String),
3372}
3373impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
3374 pub fn as_str(&self) -> &str {
3375 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3376 match self {
3377 V0 => "0",
3378 V1 => "1",
3379 V2 => "2",
3380 V3 => "3",
3381 V4 => "4",
3382 A => "A",
3383 Unknown(v) => v,
3384 }
3385 }
3386}
3387
3388impl std::str::FromStr
3389 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3390{
3391 type Err = std::convert::Infallible;
3392 fn from_str(s: &str) -> Result<Self, Self::Err> {
3393 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3394 match s {
3395 "0" => Ok(V0),
3396 "1" => Ok(V1),
3397 "2" => Ok(V2),
3398 "3" => Ok(V3),
3399 "4" => Ok(V4),
3400 "A" => Ok(A),
3401 v => {
3402 tracing::warn!(
3403 "Unknown value '{}' for enum '{}'",
3404 v,
3405 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
3406 );
3407 Ok(Unknown(v.to_owned()))
3408 }
3409 }
3410 }
3411}
3412impl std::fmt::Display
3413 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3414{
3415 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3416 f.write_str(self.as_str())
3417 }
3418}
3419
3420impl std::fmt::Debug
3421 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3422{
3423 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3424 f.write_str(self.as_str())
3425 }
3426}
3427impl serde::Serialize
3428 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3429{
3430 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3431 where
3432 S: serde::Serializer,
3433 {
3434 serializer.serialize_str(self.as_str())
3435 }
3436}
3437#[cfg(feature = "deserialize")]
3438impl<'de> serde::Deserialize<'de>
3439 for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3440{
3441 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3442 use std::str::FromStr;
3443 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3444 Ok(Self::from_str(&s).expect("infallible"))
3445 }
3446}
3447#[derive(Clone, Eq, PartialEq)]
3449#[non_exhaustive]
3450pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3451 V1_0_2,
3452 V2_1_0,
3453 V2_2_0,
3454 Unknown(String),
3456}
3457impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3458 pub fn as_str(&self) -> &str {
3459 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3460 match self {
3461 V1_0_2 => "1.0.2",
3462 V2_1_0 => "2.1.0",
3463 V2_2_0 => "2.2.0",
3464 Unknown(v) => v,
3465 }
3466 }
3467}
3468
3469impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3470 type Err = std::convert::Infallible;
3471 fn from_str(s: &str) -> Result<Self, Self::Err> {
3472 use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3473 match s {
3474 "1.0.2" => Ok(V1_0_2),
3475 "2.1.0" => Ok(V2_1_0),
3476 "2.2.0" => Ok(V2_2_0),
3477 v => {
3478 tracing::warn!(
3479 "Unknown value '{}' for enum '{}'",
3480 v,
3481 "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
3482 );
3483 Ok(Unknown(v.to_owned()))
3484 }
3485 }
3486 }
3487}
3488impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3489 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3490 f.write_str(self.as_str())
3491 }
3492}
3493
3494impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3495 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3496 f.write_str(self.as_str())
3497 }
3498}
3499impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3500 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3501 where
3502 S: serde::Serializer,
3503 {
3504 serializer.serialize_str(self.as_str())
3505 }
3506}
3507#[cfg(feature = "deserialize")]
3508impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3509 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3510 use std::str::FromStr;
3511 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3512 Ok(Self::from_str(&s).expect("infallible"))
3513 }
3514}
3515#[derive(Clone, Debug, serde::Serialize)]
3517pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
3518 #[serde(skip_serializing_if = "Option::is_none")]
3520 pub currency: Option<stripe_types::Currency>,
3521 #[serde(skip_serializing_if = "Option::is_none")]
3523 pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
3524 #[serde(skip_serializing_if = "Option::is_none")]
3526 pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
3527 #[serde(skip_serializing_if = "Option::is_none")]
3529 pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
3530}
3531impl CreateSetupIntentPaymentMethodOptionsKlarna {
3532 pub fn new() -> Self {
3533 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
3534 }
3535}
3536impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
3537 fn default() -> Self {
3538 Self::new()
3539 }
3540}
3541#[derive(Clone, Debug, serde::Serialize)]
3543pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3544 #[serde(skip_serializing_if = "Option::is_none")]
3547 pub average_amount: Option<i64>,
3548 #[serde(skip_serializing_if = "Option::is_none")]
3551 pub maximum_amount: Option<i64>,
3552 #[serde(skip_serializing_if = "Option::is_none")]
3555 pub minimum_amount: Option<i64>,
3556 #[serde(skip_serializing_if = "Option::is_none")]
3558 pub purchase_interval:
3559 Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
3560 #[serde(skip_serializing_if = "Option::is_none")]
3562 pub purchase_interval_count: Option<u64>,
3563}
3564impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3565 pub fn new() -> Self {
3566 Self {
3567 average_amount: None,
3568 maximum_amount: None,
3569 minimum_amount: None,
3570 purchase_interval: None,
3571 purchase_interval_count: None,
3572 }
3573 }
3574}
3575impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3576 fn default() -> Self {
3577 Self::new()
3578 }
3579}
3580#[derive(Clone, Eq, PartialEq)]
3582#[non_exhaustive]
3583pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3584 Day,
3585 Month,
3586 Week,
3587 Year,
3588 Unknown(String),
3590}
3591impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3592 pub fn as_str(&self) -> &str {
3593 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3594 match self {
3595 Day => "day",
3596 Month => "month",
3597 Week => "week",
3598 Year => "year",
3599 Unknown(v) => v,
3600 }
3601 }
3602}
3603
3604impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3605 type Err = std::convert::Infallible;
3606 fn from_str(s: &str) -> Result<Self, Self::Err> {
3607 use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3608 match s {
3609 "day" => Ok(Day),
3610 "month" => Ok(Month),
3611 "week" => Ok(Week),
3612 "year" => Ok(Year),
3613 v => {
3614 tracing::warn!(
3615 "Unknown value '{}' for enum '{}'",
3616 v,
3617 "CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
3618 );
3619 Ok(Unknown(v.to_owned()))
3620 }
3621 }
3622 }
3623}
3624impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3625 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3626 f.write_str(self.as_str())
3627 }
3628}
3629
3630impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3631 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3632 f.write_str(self.as_str())
3633 }
3634}
3635impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3636 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3637 where
3638 S: serde::Serializer,
3639 {
3640 serializer.serialize_str(self.as_str())
3641 }
3642}
3643#[cfg(feature = "deserialize")]
3644impl<'de> serde::Deserialize<'de>
3645 for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
3646{
3647 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3648 use std::str::FromStr;
3649 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3650 Ok(Self::from_str(&s).expect("infallible"))
3651 }
3652}
3653#[derive(Clone, Eq, PartialEq)]
3655#[non_exhaustive]
3656pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3657 CsMinusCz,
3658 DaMinusDk,
3659 DeMinusAt,
3660 DeMinusCh,
3661 DeMinusDe,
3662 ElMinusGr,
3663 EnMinusAt,
3664 EnMinusAu,
3665 EnMinusBe,
3666 EnMinusCa,
3667 EnMinusCh,
3668 EnMinusCz,
3669 EnMinusDe,
3670 EnMinusDk,
3671 EnMinusEs,
3672 EnMinusFi,
3673 EnMinusFr,
3674 EnMinusGb,
3675 EnMinusGr,
3676 EnMinusIe,
3677 EnMinusIt,
3678 EnMinusNl,
3679 EnMinusNo,
3680 EnMinusNz,
3681 EnMinusPl,
3682 EnMinusPt,
3683 EnMinusRo,
3684 EnMinusSe,
3685 EnMinusUs,
3686 EsMinusEs,
3687 EsMinusUs,
3688 FiMinusFi,
3689 FrMinusBe,
3690 FrMinusCa,
3691 FrMinusCh,
3692 FrMinusFr,
3693 ItMinusCh,
3694 ItMinusIt,
3695 NbMinusNo,
3696 NlMinusBe,
3697 NlMinusNl,
3698 PlMinusPl,
3699 PtMinusPt,
3700 RoMinusRo,
3701 SvMinusFi,
3702 SvMinusSe,
3703 Unknown(String),
3705}
3706impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3707 pub fn as_str(&self) -> &str {
3708 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3709 match self {
3710 CsMinusCz => "cs-CZ",
3711 DaMinusDk => "da-DK",
3712 DeMinusAt => "de-AT",
3713 DeMinusCh => "de-CH",
3714 DeMinusDe => "de-DE",
3715 ElMinusGr => "el-GR",
3716 EnMinusAt => "en-AT",
3717 EnMinusAu => "en-AU",
3718 EnMinusBe => "en-BE",
3719 EnMinusCa => "en-CA",
3720 EnMinusCh => "en-CH",
3721 EnMinusCz => "en-CZ",
3722 EnMinusDe => "en-DE",
3723 EnMinusDk => "en-DK",
3724 EnMinusEs => "en-ES",
3725 EnMinusFi => "en-FI",
3726 EnMinusFr => "en-FR",
3727 EnMinusGb => "en-GB",
3728 EnMinusGr => "en-GR",
3729 EnMinusIe => "en-IE",
3730 EnMinusIt => "en-IT",
3731 EnMinusNl => "en-NL",
3732 EnMinusNo => "en-NO",
3733 EnMinusNz => "en-NZ",
3734 EnMinusPl => "en-PL",
3735 EnMinusPt => "en-PT",
3736 EnMinusRo => "en-RO",
3737 EnMinusSe => "en-SE",
3738 EnMinusUs => "en-US",
3739 EsMinusEs => "es-ES",
3740 EsMinusUs => "es-US",
3741 FiMinusFi => "fi-FI",
3742 FrMinusBe => "fr-BE",
3743 FrMinusCa => "fr-CA",
3744 FrMinusCh => "fr-CH",
3745 FrMinusFr => "fr-FR",
3746 ItMinusCh => "it-CH",
3747 ItMinusIt => "it-IT",
3748 NbMinusNo => "nb-NO",
3749 NlMinusBe => "nl-BE",
3750 NlMinusNl => "nl-NL",
3751 PlMinusPl => "pl-PL",
3752 PtMinusPt => "pt-PT",
3753 RoMinusRo => "ro-RO",
3754 SvMinusFi => "sv-FI",
3755 SvMinusSe => "sv-SE",
3756 Unknown(v) => v,
3757 }
3758 }
3759}
3760
3761impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3762 type Err = std::convert::Infallible;
3763 fn from_str(s: &str) -> Result<Self, Self::Err> {
3764 use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3765 match s {
3766 "cs-CZ" => Ok(CsMinusCz),
3767 "da-DK" => Ok(DaMinusDk),
3768 "de-AT" => Ok(DeMinusAt),
3769 "de-CH" => Ok(DeMinusCh),
3770 "de-DE" => Ok(DeMinusDe),
3771 "el-GR" => Ok(ElMinusGr),
3772 "en-AT" => Ok(EnMinusAt),
3773 "en-AU" => Ok(EnMinusAu),
3774 "en-BE" => Ok(EnMinusBe),
3775 "en-CA" => Ok(EnMinusCa),
3776 "en-CH" => Ok(EnMinusCh),
3777 "en-CZ" => Ok(EnMinusCz),
3778 "en-DE" => Ok(EnMinusDe),
3779 "en-DK" => Ok(EnMinusDk),
3780 "en-ES" => Ok(EnMinusEs),
3781 "en-FI" => Ok(EnMinusFi),
3782 "en-FR" => Ok(EnMinusFr),
3783 "en-GB" => Ok(EnMinusGb),
3784 "en-GR" => Ok(EnMinusGr),
3785 "en-IE" => Ok(EnMinusIe),
3786 "en-IT" => Ok(EnMinusIt),
3787 "en-NL" => Ok(EnMinusNl),
3788 "en-NO" => Ok(EnMinusNo),
3789 "en-NZ" => Ok(EnMinusNz),
3790 "en-PL" => Ok(EnMinusPl),
3791 "en-PT" => Ok(EnMinusPt),
3792 "en-RO" => Ok(EnMinusRo),
3793 "en-SE" => Ok(EnMinusSe),
3794 "en-US" => Ok(EnMinusUs),
3795 "es-ES" => Ok(EsMinusEs),
3796 "es-US" => Ok(EsMinusUs),
3797 "fi-FI" => Ok(FiMinusFi),
3798 "fr-BE" => Ok(FrMinusBe),
3799 "fr-CA" => Ok(FrMinusCa),
3800 "fr-CH" => Ok(FrMinusCh),
3801 "fr-FR" => Ok(FrMinusFr),
3802 "it-CH" => Ok(ItMinusCh),
3803 "it-IT" => Ok(ItMinusIt),
3804 "nb-NO" => Ok(NbMinusNo),
3805 "nl-BE" => Ok(NlMinusBe),
3806 "nl-NL" => Ok(NlMinusNl),
3807 "pl-PL" => Ok(PlMinusPl),
3808 "pt-PT" => Ok(PtMinusPt),
3809 "ro-RO" => Ok(RoMinusRo),
3810 "sv-FI" => Ok(SvMinusFi),
3811 "sv-SE" => Ok(SvMinusSe),
3812 v => {
3813 tracing::warn!(
3814 "Unknown value '{}' for enum '{}'",
3815 v,
3816 "CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
3817 );
3818 Ok(Unknown(v.to_owned()))
3819 }
3820 }
3821 }
3822}
3823impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3824 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3825 f.write_str(self.as_str())
3826 }
3827}
3828
3829impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3830 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3831 f.write_str(self.as_str())
3832 }
3833}
3834impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3835 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3836 where
3837 S: serde::Serializer,
3838 {
3839 serializer.serialize_str(self.as_str())
3840 }
3841}
3842#[cfg(feature = "deserialize")]
3843impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3844 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3845 use std::str::FromStr;
3846 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3847 Ok(Self::from_str(&s).expect("infallible"))
3848 }
3849}
3850#[derive(Clone, Debug, serde::Serialize)]
3852pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3853 pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
3855 #[serde(skip_serializing_if = "Option::is_none")]
3858 pub interval_count: Option<u64>,
3859 #[serde(skip_serializing_if = "Option::is_none")]
3861 pub name: Option<String>,
3862 pub next_billing: SubscriptionNextBillingParam,
3864 pub reference: String,
3867}
3868impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3869 pub fn new(
3870 interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
3871 next_billing: impl Into<SubscriptionNextBillingParam>,
3872 reference: impl Into<String>,
3873 ) -> Self {
3874 Self {
3875 interval: interval.into(),
3876 interval_count: None,
3877 name: None,
3878 next_billing: next_billing.into(),
3879 reference: reference.into(),
3880 }
3881 }
3882}
3883#[derive(Clone, Eq, PartialEq)]
3885#[non_exhaustive]
3886pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3887 Day,
3888 Month,
3889 Week,
3890 Year,
3891 Unknown(String),
3893}
3894impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3895 pub fn as_str(&self) -> &str {
3896 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3897 match self {
3898 Day => "day",
3899 Month => "month",
3900 Week => "week",
3901 Year => "year",
3902 Unknown(v) => v,
3903 }
3904 }
3905}
3906
3907impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3908 type Err = std::convert::Infallible;
3909 fn from_str(s: &str) -> Result<Self, Self::Err> {
3910 use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3911 match s {
3912 "day" => Ok(Day),
3913 "month" => Ok(Month),
3914 "week" => Ok(Week),
3915 "year" => Ok(Year),
3916 v => {
3917 tracing::warn!(
3918 "Unknown value '{}' for enum '{}'",
3919 v,
3920 "CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
3921 );
3922 Ok(Unknown(v.to_owned()))
3923 }
3924 }
3925 }
3926}
3927impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3928 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3929 f.write_str(self.as_str())
3930 }
3931}
3932
3933impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3934 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3935 f.write_str(self.as_str())
3936 }
3937}
3938impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3939 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3940 where
3941 S: serde::Serializer,
3942 {
3943 serializer.serialize_str(self.as_str())
3944 }
3945}
3946#[cfg(feature = "deserialize")]
3947impl<'de> serde::Deserialize<'de>
3948 for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
3949{
3950 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3951 use std::str::FromStr;
3952 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3953 Ok(Self::from_str(&s).expect("infallible"))
3954 }
3955}
3956#[derive(Clone, Debug, serde::Serialize)]
3958pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
3959 #[serde(skip_serializing_if = "Option::is_none")]
3961 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
3962}
3963impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
3964 pub fn new() -> Self {
3965 Self { mandate_options: None }
3966 }
3967}
3968impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
3969 fn default() -> Self {
3970 Self::new()
3971 }
3972}
3973#[derive(Clone, Debug, serde::Serialize)]
3975pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3976 #[serde(skip_serializing_if = "Option::is_none")]
3981 pub reference_prefix: Option<String>,
3982}
3983impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3984 pub fn new() -> Self {
3985 Self { reference_prefix: None }
3986 }
3987}
3988impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3989 fn default() -> Self {
3990 Self::new()
3991 }
3992}
3993#[derive(Clone, Debug, serde::Serialize)]
3995pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3996 #[serde(skip_serializing_if = "Option::is_none")]
3998 pub financial_connections:
3999 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
4000 #[serde(skip_serializing_if = "Option::is_none")]
4002 pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
4003 #[serde(skip_serializing_if = "Option::is_none")]
4005 pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
4006 #[serde(skip_serializing_if = "Option::is_none")]
4008 pub verification_method:
4009 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
4010}
4011impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
4012 pub fn new() -> Self {
4013 Self {
4014 financial_connections: None,
4015 mandate_options: None,
4016 networks: None,
4017 verification_method: None,
4018 }
4019 }
4020}
4021impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
4022 fn default() -> Self {
4023 Self::new()
4024 }
4025}
4026#[derive(Clone, Debug, serde::Serialize)]
4028pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4029 #[serde(skip_serializing_if = "Option::is_none")]
4031 pub filters:
4032 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
4033 #[serde(skip_serializing_if = "Option::is_none")]
4037 pub permissions: Option<
4038 Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
4039 >,
4040 #[serde(skip_serializing_if = "Option::is_none")]
4042 pub prefetch:
4043 Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
4044 #[serde(skip_serializing_if = "Option::is_none")]
4047 pub return_url: Option<String>,
4048}
4049impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4050 pub fn new() -> Self {
4051 Self { filters: None, permissions: None, prefetch: None, return_url: None }
4052 }
4053}
4054impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4055 fn default() -> Self {
4056 Self::new()
4057 }
4058}
4059#[derive(Clone, Debug, serde::Serialize)]
4061pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4062 #[serde(skip_serializing_if = "Option::is_none")]
4065pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
4066
4067}
4068impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4069 pub fn new() -> Self {
4070 Self { account_subcategories: None }
4071 }
4072}
4073impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4074 fn default() -> Self {
4075 Self::new()
4076 }
4077}
4078#[derive(Clone, Eq, PartialEq)]
4081#[non_exhaustive]
4082pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
4083{
4084 Checking,
4085 Savings,
4086 Unknown(String),
4088}
4089impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4090 pub fn as_str(&self) -> &str {
4091 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
4092 match self {
4093Checking => "checking",
4094Savings => "savings",
4095Unknown(v) => v,
4096
4097 }
4098 }
4099}
4100
4101impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4102 type Err = std::convert::Infallible;
4103 fn from_str(s: &str) -> Result<Self, Self::Err> {
4104 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
4105 match s {
4106 "checking" => Ok(Checking),
4107"savings" => Ok(Savings),
4108v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
4109
4110 }
4111 }
4112}
4113impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4114 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4115 f.write_str(self.as_str())
4116 }
4117}
4118
4119impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4120 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4121 f.write_str(self.as_str())
4122 }
4123}
4124impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4125 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
4126 serializer.serialize_str(self.as_str())
4127 }
4128}
4129#[cfg(feature = "deserialize")]
4130impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4131 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4132 use std::str::FromStr;
4133 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4134 Ok(Self::from_str(&s).expect("infallible"))
4135 }
4136}
4137#[derive(Clone, Eq, PartialEq)]
4141#[non_exhaustive]
4142pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
4143 Balances,
4144 Ownership,
4145 PaymentMethod,
4146 Transactions,
4147 Unknown(String),
4149}
4150impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
4151 pub fn as_str(&self) -> &str {
4152 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
4153 match self {
4154 Balances => "balances",
4155 Ownership => "ownership",
4156 PaymentMethod => "payment_method",
4157 Transactions => "transactions",
4158 Unknown(v) => v,
4159 }
4160 }
4161}
4162
4163impl std::str::FromStr
4164 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4165{
4166 type Err = std::convert::Infallible;
4167 fn from_str(s: &str) -> Result<Self, Self::Err> {
4168 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
4169 match s {
4170 "balances" => Ok(Balances),
4171 "ownership" => Ok(Ownership),
4172 "payment_method" => Ok(PaymentMethod),
4173 "transactions" => Ok(Transactions),
4174 v => {
4175 tracing::warn!(
4176 "Unknown value '{}' for enum '{}'",
4177 v,
4178 "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
4179 );
4180 Ok(Unknown(v.to_owned()))
4181 }
4182 }
4183 }
4184}
4185impl std::fmt::Display
4186 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4187{
4188 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4189 f.write_str(self.as_str())
4190 }
4191}
4192
4193impl std::fmt::Debug
4194 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4195{
4196 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4197 f.write_str(self.as_str())
4198 }
4199}
4200impl serde::Serialize
4201 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4202{
4203 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4204 where
4205 S: serde::Serializer,
4206 {
4207 serializer.serialize_str(self.as_str())
4208 }
4209}
4210#[cfg(feature = "deserialize")]
4211impl<'de> serde::Deserialize<'de>
4212 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4213{
4214 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4215 use std::str::FromStr;
4216 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4217 Ok(Self::from_str(&s).expect("infallible"))
4218 }
4219}
4220#[derive(Clone, Eq, PartialEq)]
4222#[non_exhaustive]
4223pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
4224 Balances,
4225 Ownership,
4226 Transactions,
4227 Unknown(String),
4229}
4230impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
4231 pub fn as_str(&self) -> &str {
4232 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
4233 match self {
4234 Balances => "balances",
4235 Ownership => "ownership",
4236 Transactions => "transactions",
4237 Unknown(v) => v,
4238 }
4239 }
4240}
4241
4242impl std::str::FromStr
4243 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4244{
4245 type Err = std::convert::Infallible;
4246 fn from_str(s: &str) -> Result<Self, Self::Err> {
4247 use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
4248 match s {
4249 "balances" => Ok(Balances),
4250 "ownership" => Ok(Ownership),
4251 "transactions" => Ok(Transactions),
4252 v => {
4253 tracing::warn!(
4254 "Unknown value '{}' for enum '{}'",
4255 v,
4256 "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
4257 );
4258 Ok(Unknown(v.to_owned()))
4259 }
4260 }
4261 }
4262}
4263impl std::fmt::Display
4264 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4265{
4266 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4267 f.write_str(self.as_str())
4268 }
4269}
4270
4271impl std::fmt::Debug
4272 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4273{
4274 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4275 f.write_str(self.as_str())
4276 }
4277}
4278impl serde::Serialize
4279 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4280{
4281 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4282 where
4283 S: serde::Serializer,
4284 {
4285 serializer.serialize_str(self.as_str())
4286 }
4287}
4288#[cfg(feature = "deserialize")]
4289impl<'de> serde::Deserialize<'de>
4290 for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4291{
4292 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4293 use std::str::FromStr;
4294 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4295 Ok(Self::from_str(&s).expect("infallible"))
4296 }
4297}
4298#[derive(Clone, Debug, serde::Serialize)]
4300pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4301 #[serde(skip_serializing_if = "Option::is_none")]
4303 pub collection_method:
4304 Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
4305}
4306impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4307 pub fn new() -> Self {
4308 Self { collection_method: None }
4309 }
4310}
4311impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4312 fn default() -> Self {
4313 Self::new()
4314 }
4315}
4316#[derive(Clone, Eq, PartialEq)]
4318#[non_exhaustive]
4319pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4320 Paper,
4321 Unknown(String),
4323}
4324impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4325 pub fn as_str(&self) -> &str {
4326 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4327 match self {
4328 Paper => "paper",
4329 Unknown(v) => v,
4330 }
4331 }
4332}
4333
4334impl std::str::FromStr
4335 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4336{
4337 type Err = std::convert::Infallible;
4338 fn from_str(s: &str) -> Result<Self, Self::Err> {
4339 use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4340 match s {
4341 "paper" => Ok(Paper),
4342 v => {
4343 tracing::warn!(
4344 "Unknown value '{}' for enum '{}'",
4345 v,
4346 "CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
4347 );
4348 Ok(Unknown(v.to_owned()))
4349 }
4350 }
4351 }
4352}
4353impl std::fmt::Display
4354 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4355{
4356 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4357 f.write_str(self.as_str())
4358 }
4359}
4360
4361impl std::fmt::Debug
4362 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4363{
4364 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4365 f.write_str(self.as_str())
4366 }
4367}
4368impl serde::Serialize
4369 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4370{
4371 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4372 where
4373 S: serde::Serializer,
4374 {
4375 serializer.serialize_str(self.as_str())
4376 }
4377}
4378#[cfg(feature = "deserialize")]
4379impl<'de> serde::Deserialize<'de>
4380 for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4381{
4382 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4383 use std::str::FromStr;
4384 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4385 Ok(Self::from_str(&s).expect("infallible"))
4386 }
4387}
4388#[derive(Clone, Debug, serde::Serialize)]
4390pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4391 #[serde(skip_serializing_if = "Option::is_none")]
4393 pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
4394}
4395impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4396 pub fn new() -> Self {
4397 Self { requested: None }
4398 }
4399}
4400impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4401 fn default() -> Self {
4402 Self::new()
4403 }
4404}
4405#[derive(Clone, Eq, PartialEq)]
4407#[non_exhaustive]
4408pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4409 Ach,
4410 UsDomesticWire,
4411 Unknown(String),
4413}
4414impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4415 pub fn as_str(&self) -> &str {
4416 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4417 match self {
4418 Ach => "ach",
4419 UsDomesticWire => "us_domestic_wire",
4420 Unknown(v) => v,
4421 }
4422 }
4423}
4424
4425impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4426 type Err = std::convert::Infallible;
4427 fn from_str(s: &str) -> Result<Self, Self::Err> {
4428 use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4429 match s {
4430 "ach" => Ok(Ach),
4431 "us_domestic_wire" => Ok(UsDomesticWire),
4432 v => {
4433 tracing::warn!(
4434 "Unknown value '{}' for enum '{}'",
4435 v,
4436 "CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
4437 );
4438 Ok(Unknown(v.to_owned()))
4439 }
4440 }
4441 }
4442}
4443impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4444 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4445 f.write_str(self.as_str())
4446 }
4447}
4448
4449impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4450 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4451 f.write_str(self.as_str())
4452 }
4453}
4454impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4455 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4456 where
4457 S: serde::Serializer,
4458 {
4459 serializer.serialize_str(self.as_str())
4460 }
4461}
4462#[cfg(feature = "deserialize")]
4463impl<'de> serde::Deserialize<'de>
4464 for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
4465{
4466 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4467 use std::str::FromStr;
4468 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4469 Ok(Self::from_str(&s).expect("infallible"))
4470 }
4471}
4472#[derive(Clone, Eq, PartialEq)]
4474#[non_exhaustive]
4475pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4476 Automatic,
4477 Instant,
4478 Microdeposits,
4479 Unknown(String),
4481}
4482impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4483 pub fn as_str(&self) -> &str {
4484 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4485 match self {
4486 Automatic => "automatic",
4487 Instant => "instant",
4488 Microdeposits => "microdeposits",
4489 Unknown(v) => v,
4490 }
4491 }
4492}
4493
4494impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4495 type Err = std::convert::Infallible;
4496 fn from_str(s: &str) -> Result<Self, Self::Err> {
4497 use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4498 match s {
4499 "automatic" => Ok(Automatic),
4500 "instant" => Ok(Instant),
4501 "microdeposits" => Ok(Microdeposits),
4502 v => {
4503 tracing::warn!(
4504 "Unknown value '{}' for enum '{}'",
4505 v,
4506 "CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
4507 );
4508 Ok(Unknown(v.to_owned()))
4509 }
4510 }
4511 }
4512}
4513impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4514 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4515 f.write_str(self.as_str())
4516 }
4517}
4518
4519impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4520 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4521 f.write_str(self.as_str())
4522 }
4523}
4524impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4525 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4526 where
4527 S: serde::Serializer,
4528 {
4529 serializer.serialize_str(self.as_str())
4530 }
4531}
4532#[cfg(feature = "deserialize")]
4533impl<'de> serde::Deserialize<'de>
4534 for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
4535{
4536 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4537 use std::str::FromStr;
4538 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4539 Ok(Self::from_str(&s).expect("infallible"))
4540 }
4541}
4542#[derive(Clone, Debug, serde::Serialize)]
4546pub struct CreateSetupIntentSingleUse {
4547 pub amount: i64,
4552 pub currency: stripe_types::Currency,
4555}
4556impl CreateSetupIntentSingleUse {
4557 pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
4558 Self { amount: amount.into(), currency: currency.into() }
4559 }
4560}
4561#[derive(Clone, Eq, PartialEq)]
4564#[non_exhaustive]
4565pub enum CreateSetupIntentUsage {
4566 OffSession,
4567 OnSession,
4568 Unknown(String),
4570}
4571impl CreateSetupIntentUsage {
4572 pub fn as_str(&self) -> &str {
4573 use CreateSetupIntentUsage::*;
4574 match self {
4575 OffSession => "off_session",
4576 OnSession => "on_session",
4577 Unknown(v) => v,
4578 }
4579 }
4580}
4581
4582impl std::str::FromStr for CreateSetupIntentUsage {
4583 type Err = std::convert::Infallible;
4584 fn from_str(s: &str) -> Result<Self, Self::Err> {
4585 use CreateSetupIntentUsage::*;
4586 match s {
4587 "off_session" => Ok(OffSession),
4588 "on_session" => Ok(OnSession),
4589 v => {
4590 tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentUsage");
4591 Ok(Unknown(v.to_owned()))
4592 }
4593 }
4594 }
4595}
4596impl std::fmt::Display for CreateSetupIntentUsage {
4597 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4598 f.write_str(self.as_str())
4599 }
4600}
4601
4602impl std::fmt::Debug for CreateSetupIntentUsage {
4603 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4604 f.write_str(self.as_str())
4605 }
4606}
4607impl serde::Serialize for CreateSetupIntentUsage {
4608 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4609 where
4610 S: serde::Serializer,
4611 {
4612 serializer.serialize_str(self.as_str())
4613 }
4614}
4615#[cfg(feature = "deserialize")]
4616impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
4617 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4618 use std::str::FromStr;
4619 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4620 Ok(Self::from_str(&s).expect("infallible"))
4621 }
4622}
4623#[derive(Clone, Debug, serde::Serialize)]
4628pub struct CreateSetupIntent {
4629 inner: CreateSetupIntentBuilder,
4630}
4631impl CreateSetupIntent {
4632 pub fn new() -> Self {
4634 Self { inner: CreateSetupIntentBuilder::new() }
4635 }
4636 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
4641 self.inner.attach_to_self = Some(attach_to_self.into());
4642 self
4643 }
4644 pub fn automatic_payment_methods(
4646 mut self,
4647 automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
4648 ) -> Self {
4649 self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
4650 self
4651 }
4652 pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
4656 self.inner.confirm = Some(confirm.into());
4657 self
4658 }
4659 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
4663 self.inner.confirmation_token = Some(confirmation_token.into());
4664 self
4665 }
4666 pub fn customer(mut self, customer: impl Into<String>) -> Self {
4671 self.inner.customer = Some(customer.into());
4672 self
4673 }
4674 pub fn description(mut self, description: impl Into<String>) -> Self {
4676 self.inner.description = Some(description.into());
4677 self
4678 }
4679 pub fn excluded_payment_method_types(
4681 mut self,
4682 excluded_payment_method_types: impl Into<
4683 Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
4684 >,
4685 ) -> Self {
4686 self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
4687 self
4688 }
4689 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4691 self.inner.expand = Some(expand.into());
4692 self
4693 }
4694 pub fn flow_directions(
4700 mut self,
4701 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
4702 ) -> Self {
4703 self.inner.flow_directions = Some(flow_directions.into());
4704 self
4705 }
4706 pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
4709 self.inner.mandate_data = Some(mandate_data.into());
4710 self
4711 }
4712 pub fn metadata(
4717 mut self,
4718 metadata: impl Into<std::collections::HashMap<String, String>>,
4719 ) -> Self {
4720 self.inner.metadata = Some(metadata.into());
4721 self
4722 }
4723 pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
4725 self.inner.on_behalf_of = Some(on_behalf_of.into());
4726 self
4727 }
4728 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
4730 self.inner.payment_method = Some(payment_method.into());
4731 self
4732 }
4733 pub fn payment_method_configuration(
4735 mut self,
4736 payment_method_configuration: impl Into<String>,
4737 ) -> Self {
4738 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
4739 self
4740 }
4741 pub fn payment_method_data(
4744 mut self,
4745 payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
4746 ) -> Self {
4747 self.inner.payment_method_data = Some(payment_method_data.into());
4748 self
4749 }
4750 pub fn payment_method_options(
4752 mut self,
4753 payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
4754 ) -> Self {
4755 self.inner.payment_method_options = Some(payment_method_options.into());
4756 self
4757 }
4758 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
4762 self.inner.payment_method_types = Some(payment_method_types.into());
4763 self
4764 }
4765 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
4769 self.inner.return_url = Some(return_url.into());
4770 self
4771 }
4772 pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
4776 self.inner.single_use = Some(single_use.into());
4777 self
4778 }
4779 pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
4782 self.inner.usage = Some(usage.into());
4783 self
4784 }
4785 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
4787 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
4788 self
4789 }
4790}
4791impl Default for CreateSetupIntent {
4792 fn default() -> Self {
4793 Self::new()
4794 }
4795}
4796impl CreateSetupIntent {
4797 pub async fn send<C: StripeClient>(
4799 &self,
4800 client: &C,
4801 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4802 self.customize().send(client).await
4803 }
4804
4805 pub fn send_blocking<C: StripeBlockingClient>(
4807 &self,
4808 client: &C,
4809 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4810 self.customize().send_blocking(client)
4811 }
4812}
4813
4814impl StripeRequest for CreateSetupIntent {
4815 type Output = stripe_shared::SetupIntent;
4816
4817 fn build(&self) -> RequestBuilder {
4818 RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
4819 }
4820}
4821#[derive(Clone, Debug, serde::Serialize)]
4822struct UpdateSetupIntentBuilder {
4823 #[serde(skip_serializing_if = "Option::is_none")]
4824 attach_to_self: Option<bool>,
4825 #[serde(skip_serializing_if = "Option::is_none")]
4826 customer: Option<String>,
4827 #[serde(skip_serializing_if = "Option::is_none")]
4828 description: Option<String>,
4829 #[serde(skip_serializing_if = "Option::is_none")]
4830 excluded_payment_method_types:
4831 Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
4832 #[serde(skip_serializing_if = "Option::is_none")]
4833 expand: Option<Vec<String>>,
4834 #[serde(skip_serializing_if = "Option::is_none")]
4835 flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
4836 #[serde(skip_serializing_if = "Option::is_none")]
4837 metadata: Option<std::collections::HashMap<String, String>>,
4838 #[serde(skip_serializing_if = "Option::is_none")]
4839 payment_method: Option<String>,
4840 #[serde(skip_serializing_if = "Option::is_none")]
4841 payment_method_configuration: Option<String>,
4842 #[serde(skip_serializing_if = "Option::is_none")]
4843 payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
4844 #[serde(skip_serializing_if = "Option::is_none")]
4845 payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
4846 #[serde(skip_serializing_if = "Option::is_none")]
4847 payment_method_types: Option<Vec<String>>,
4848}
4849impl UpdateSetupIntentBuilder {
4850 fn new() -> Self {
4851 Self {
4852 attach_to_self: None,
4853 customer: None,
4854 description: None,
4855 excluded_payment_method_types: None,
4856 expand: None,
4857 flow_directions: None,
4858 metadata: None,
4859 payment_method: None,
4860 payment_method_configuration: None,
4861 payment_method_data: None,
4862 payment_method_options: None,
4863 payment_method_types: None,
4864 }
4865 }
4866}
4867#[derive(Clone, Debug, serde::Serialize)]
4870pub struct UpdateSetupIntentPaymentMethodData {
4871 #[serde(skip_serializing_if = "Option::is_none")]
4873 pub acss_debit: Option<PaymentMethodParam>,
4874 #[serde(skip_serializing_if = "Option::is_none")]
4876 #[serde(with = "stripe_types::with_serde_json_opt")]
4877 pub affirm: Option<miniserde::json::Value>,
4878 #[serde(skip_serializing_if = "Option::is_none")]
4880 #[serde(with = "stripe_types::with_serde_json_opt")]
4881 pub afterpay_clearpay: Option<miniserde::json::Value>,
4882 #[serde(skip_serializing_if = "Option::is_none")]
4884 #[serde(with = "stripe_types::with_serde_json_opt")]
4885 pub alipay: Option<miniserde::json::Value>,
4886 #[serde(skip_serializing_if = "Option::is_none")]
4890 pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
4891 #[serde(skip_serializing_if = "Option::is_none")]
4893 #[serde(with = "stripe_types::with_serde_json_opt")]
4894 pub alma: Option<miniserde::json::Value>,
4895 #[serde(skip_serializing_if = "Option::is_none")]
4897 #[serde(with = "stripe_types::with_serde_json_opt")]
4898 pub amazon_pay: Option<miniserde::json::Value>,
4899 #[serde(skip_serializing_if = "Option::is_none")]
4901 pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
4902 #[serde(skip_serializing_if = "Option::is_none")]
4904 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
4905 #[serde(skip_serializing_if = "Option::is_none")]
4907 #[serde(with = "stripe_types::with_serde_json_opt")]
4908 pub bancontact: Option<miniserde::json::Value>,
4909 #[serde(skip_serializing_if = "Option::is_none")]
4911 #[serde(with = "stripe_types::with_serde_json_opt")]
4912 pub billie: Option<miniserde::json::Value>,
4913 #[serde(skip_serializing_if = "Option::is_none")]
4915 pub billing_details: Option<BillingDetailsInnerParams>,
4916 #[serde(skip_serializing_if = "Option::is_none")]
4918 #[serde(with = "stripe_types::with_serde_json_opt")]
4919 pub blik: Option<miniserde::json::Value>,
4920 #[serde(skip_serializing_if = "Option::is_none")]
4922 pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
4923 #[serde(skip_serializing_if = "Option::is_none")]
4925 #[serde(with = "stripe_types::with_serde_json_opt")]
4926 pub cashapp: Option<miniserde::json::Value>,
4927 #[serde(skip_serializing_if = "Option::is_none")]
4929 #[serde(with = "stripe_types::with_serde_json_opt")]
4930 pub crypto: Option<miniserde::json::Value>,
4931 #[serde(skip_serializing_if = "Option::is_none")]
4933 #[serde(with = "stripe_types::with_serde_json_opt")]
4934 pub customer_balance: Option<miniserde::json::Value>,
4935 #[serde(skip_serializing_if = "Option::is_none")]
4937 pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
4938 #[serde(skip_serializing_if = "Option::is_none")]
4940 pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
4941 #[serde(skip_serializing_if = "Option::is_none")]
4943 #[serde(with = "stripe_types::with_serde_json_opt")]
4944 pub giropay: Option<miniserde::json::Value>,
4945 #[serde(skip_serializing_if = "Option::is_none")]
4947 #[serde(with = "stripe_types::with_serde_json_opt")]
4948 pub grabpay: Option<miniserde::json::Value>,
4949 #[serde(skip_serializing_if = "Option::is_none")]
4951 pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
4952 #[serde(skip_serializing_if = "Option::is_none")]
4954 #[serde(with = "stripe_types::with_serde_json_opt")]
4955 pub interac_present: Option<miniserde::json::Value>,
4956 #[serde(skip_serializing_if = "Option::is_none")]
4958 #[serde(with = "stripe_types::with_serde_json_opt")]
4959 pub kakao_pay: Option<miniserde::json::Value>,
4960 #[serde(skip_serializing_if = "Option::is_none")]
4962 pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
4963 #[serde(skip_serializing_if = "Option::is_none")]
4965 #[serde(with = "stripe_types::with_serde_json_opt")]
4966 pub konbini: Option<miniserde::json::Value>,
4967 #[serde(skip_serializing_if = "Option::is_none")]
4969 #[serde(with = "stripe_types::with_serde_json_opt")]
4970 pub kr_card: Option<miniserde::json::Value>,
4971 #[serde(skip_serializing_if = "Option::is_none")]
4973 #[serde(with = "stripe_types::with_serde_json_opt")]
4974 pub link: Option<miniserde::json::Value>,
4975 #[serde(skip_serializing_if = "Option::is_none")]
4977 #[serde(with = "stripe_types::with_serde_json_opt")]
4978 pub mb_way: Option<miniserde::json::Value>,
4979 #[serde(skip_serializing_if = "Option::is_none")]
4984 pub metadata: Option<std::collections::HashMap<String, String>>,
4985 #[serde(skip_serializing_if = "Option::is_none")]
4987 #[serde(with = "stripe_types::with_serde_json_opt")]
4988 pub mobilepay: Option<miniserde::json::Value>,
4989 #[serde(skip_serializing_if = "Option::is_none")]
4991 #[serde(with = "stripe_types::with_serde_json_opt")]
4992 pub multibanco: Option<miniserde::json::Value>,
4993 #[serde(skip_serializing_if = "Option::is_none")]
4995 pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
4996 #[serde(skip_serializing_if = "Option::is_none")]
4998 pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
4999 #[serde(skip_serializing_if = "Option::is_none")]
5001 #[serde(with = "stripe_types::with_serde_json_opt")]
5002 pub oxxo: Option<miniserde::json::Value>,
5003 #[serde(skip_serializing_if = "Option::is_none")]
5005 pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
5006 #[serde(skip_serializing_if = "Option::is_none")]
5008 #[serde(with = "stripe_types::with_serde_json_opt")]
5009 pub pay_by_bank: Option<miniserde::json::Value>,
5010 #[serde(skip_serializing_if = "Option::is_none")]
5012 #[serde(with = "stripe_types::with_serde_json_opt")]
5013 pub payco: Option<miniserde::json::Value>,
5014 #[serde(skip_serializing_if = "Option::is_none")]
5016 #[serde(with = "stripe_types::with_serde_json_opt")]
5017 pub paynow: Option<miniserde::json::Value>,
5018 #[serde(skip_serializing_if = "Option::is_none")]
5020 #[serde(with = "stripe_types::with_serde_json_opt")]
5021 pub paypal: Option<miniserde::json::Value>,
5022 #[serde(skip_serializing_if = "Option::is_none")]
5024 #[serde(with = "stripe_types::with_serde_json_opt")]
5025 pub pix: Option<miniserde::json::Value>,
5026 #[serde(skip_serializing_if = "Option::is_none")]
5028 #[serde(with = "stripe_types::with_serde_json_opt")]
5029 pub promptpay: Option<miniserde::json::Value>,
5030 #[serde(skip_serializing_if = "Option::is_none")]
5033 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
5034 #[serde(skip_serializing_if = "Option::is_none")]
5036 #[serde(with = "stripe_types::with_serde_json_opt")]
5037 pub revolut_pay: Option<miniserde::json::Value>,
5038 #[serde(skip_serializing_if = "Option::is_none")]
5040 #[serde(with = "stripe_types::with_serde_json_opt")]
5041 pub samsung_pay: Option<miniserde::json::Value>,
5042 #[serde(skip_serializing_if = "Option::is_none")]
5044 #[serde(with = "stripe_types::with_serde_json_opt")]
5045 pub satispay: Option<miniserde::json::Value>,
5046 #[serde(skip_serializing_if = "Option::is_none")]
5048 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
5049 #[serde(skip_serializing_if = "Option::is_none")]
5051 pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
5052 #[serde(skip_serializing_if = "Option::is_none")]
5054 #[serde(with = "stripe_types::with_serde_json_opt")]
5055 pub swish: Option<miniserde::json::Value>,
5056 #[serde(skip_serializing_if = "Option::is_none")]
5058 #[serde(with = "stripe_types::with_serde_json_opt")]
5059 pub twint: Option<miniserde::json::Value>,
5060 #[serde(rename = "type")]
5064 pub type_: UpdateSetupIntentPaymentMethodDataType,
5065 #[serde(skip_serializing_if = "Option::is_none")]
5067 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
5068 #[serde(skip_serializing_if = "Option::is_none")]
5070 #[serde(with = "stripe_types::with_serde_json_opt")]
5071 pub wechat_pay: Option<miniserde::json::Value>,
5072 #[serde(skip_serializing_if = "Option::is_none")]
5074 #[serde(with = "stripe_types::with_serde_json_opt")]
5075 pub zip: Option<miniserde::json::Value>,
5076}
5077impl UpdateSetupIntentPaymentMethodData {
5078 pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
5079 Self {
5080 acss_debit: None,
5081 affirm: None,
5082 afterpay_clearpay: None,
5083 alipay: None,
5084 allow_redisplay: None,
5085 alma: None,
5086 amazon_pay: None,
5087 au_becs_debit: None,
5088 bacs_debit: None,
5089 bancontact: None,
5090 billie: None,
5091 billing_details: None,
5092 blik: None,
5093 boleto: None,
5094 cashapp: None,
5095 crypto: None,
5096 customer_balance: None,
5097 eps: None,
5098 fpx: None,
5099 giropay: None,
5100 grabpay: None,
5101 ideal: None,
5102 interac_present: None,
5103 kakao_pay: None,
5104 klarna: None,
5105 konbini: None,
5106 kr_card: None,
5107 link: None,
5108 mb_way: None,
5109 metadata: None,
5110 mobilepay: None,
5111 multibanco: None,
5112 naver_pay: None,
5113 nz_bank_account: None,
5114 oxxo: None,
5115 p24: None,
5116 pay_by_bank: None,
5117 payco: None,
5118 paynow: None,
5119 paypal: None,
5120 pix: None,
5121 promptpay: None,
5122 radar_options: None,
5123 revolut_pay: None,
5124 samsung_pay: None,
5125 satispay: None,
5126 sepa_debit: None,
5127 sofort: None,
5128 swish: None,
5129 twint: None,
5130 type_: type_.into(),
5131 us_bank_account: None,
5132 wechat_pay: None,
5133 zip: None,
5134 }
5135 }
5136}
5137#[derive(Clone, Eq, PartialEq)]
5141#[non_exhaustive]
5142pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5143 Always,
5144 Limited,
5145 Unspecified,
5146 Unknown(String),
5148}
5149impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5150 pub fn as_str(&self) -> &str {
5151 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
5152 match self {
5153 Always => "always",
5154 Limited => "limited",
5155 Unspecified => "unspecified",
5156 Unknown(v) => v,
5157 }
5158 }
5159}
5160
5161impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5162 type Err = std::convert::Infallible;
5163 fn from_str(s: &str) -> Result<Self, Self::Err> {
5164 use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
5165 match s {
5166 "always" => Ok(Always),
5167 "limited" => Ok(Limited),
5168 "unspecified" => Ok(Unspecified),
5169 v => {
5170 tracing::warn!(
5171 "Unknown value '{}' for enum '{}'",
5172 v,
5173 "UpdateSetupIntentPaymentMethodDataAllowRedisplay"
5174 );
5175 Ok(Unknown(v.to_owned()))
5176 }
5177 }
5178 }
5179}
5180impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5181 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5182 f.write_str(self.as_str())
5183 }
5184}
5185
5186impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5187 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5188 f.write_str(self.as_str())
5189 }
5190}
5191impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5192 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5193 where
5194 S: serde::Serializer,
5195 {
5196 serializer.serialize_str(self.as_str())
5197 }
5198}
5199#[cfg(feature = "deserialize")]
5200impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5201 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5202 use std::str::FromStr;
5203 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5204 Ok(Self::from_str(&s).expect("infallible"))
5205 }
5206}
5207#[derive(Clone, Debug, serde::Serialize)]
5209pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
5210 pub account_number: String,
5212 pub bsb_number: String,
5214}
5215impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
5216 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
5217 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
5218 }
5219}
5220#[derive(Clone, Debug, serde::Serialize)]
5222pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
5223 #[serde(skip_serializing_if = "Option::is_none")]
5225 pub account_number: Option<String>,
5226 #[serde(skip_serializing_if = "Option::is_none")]
5228 pub sort_code: Option<String>,
5229}
5230impl UpdateSetupIntentPaymentMethodDataBacsDebit {
5231 pub fn new() -> Self {
5232 Self { account_number: None, sort_code: None }
5233 }
5234}
5235impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
5236 fn default() -> Self {
5237 Self::new()
5238 }
5239}
5240#[derive(Clone, Debug, serde::Serialize)]
5242pub struct UpdateSetupIntentPaymentMethodDataBoleto {
5243 pub tax_id: String,
5245}
5246impl UpdateSetupIntentPaymentMethodDataBoleto {
5247 pub fn new(tax_id: impl Into<String>) -> Self {
5248 Self { tax_id: tax_id.into() }
5249 }
5250}
5251#[derive(Clone, Debug, serde::Serialize)]
5253pub struct UpdateSetupIntentPaymentMethodDataEps {
5254 #[serde(skip_serializing_if = "Option::is_none")]
5256 pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
5257}
5258impl UpdateSetupIntentPaymentMethodDataEps {
5259 pub fn new() -> Self {
5260 Self { bank: None }
5261 }
5262}
5263impl Default for UpdateSetupIntentPaymentMethodDataEps {
5264 fn default() -> Self {
5265 Self::new()
5266 }
5267}
5268#[derive(Clone, Eq, PartialEq)]
5270#[non_exhaustive]
5271pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
5272 ArzteUndApothekerBank,
5273 AustrianAnadiBankAg,
5274 BankAustria,
5275 BankhausCarlSpangler,
5276 BankhausSchelhammerUndSchatteraAg,
5277 BawagPskAg,
5278 BksBankAg,
5279 BrullKallmusBankAg,
5280 BtvVierLanderBank,
5281 CapitalBankGraweGruppeAg,
5282 DeutscheBankAg,
5283 Dolomitenbank,
5284 EasybankAg,
5285 ErsteBankUndSparkassen,
5286 HypoAlpeadriabankInternationalAg,
5287 HypoBankBurgenlandAktiengesellschaft,
5288 HypoNoeLbFurNiederosterreichUWien,
5289 HypoOberosterreichSalzburgSteiermark,
5290 HypoTirolBankAg,
5291 HypoVorarlbergBankAg,
5292 MarchfelderBank,
5293 OberbankAg,
5294 RaiffeisenBankengruppeOsterreich,
5295 SchoellerbankAg,
5296 SpardaBankWien,
5297 VolksbankGruppe,
5298 VolkskreditbankAg,
5299 VrBankBraunau,
5300 Unknown(String),
5302}
5303impl UpdateSetupIntentPaymentMethodDataEpsBank {
5304 pub fn as_str(&self) -> &str {
5305 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5306 match self {
5307 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
5308 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
5309 BankAustria => "bank_austria",
5310 BankhausCarlSpangler => "bankhaus_carl_spangler",
5311 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
5312 BawagPskAg => "bawag_psk_ag",
5313 BksBankAg => "bks_bank_ag",
5314 BrullKallmusBankAg => "brull_kallmus_bank_ag",
5315 BtvVierLanderBank => "btv_vier_lander_bank",
5316 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
5317 DeutscheBankAg => "deutsche_bank_ag",
5318 Dolomitenbank => "dolomitenbank",
5319 EasybankAg => "easybank_ag",
5320 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
5321 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
5322 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
5323 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
5324 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
5325 HypoTirolBankAg => "hypo_tirol_bank_ag",
5326 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
5327 MarchfelderBank => "marchfelder_bank",
5328 OberbankAg => "oberbank_ag",
5329 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
5330 SchoellerbankAg => "schoellerbank_ag",
5331 SpardaBankWien => "sparda_bank_wien",
5332 VolksbankGruppe => "volksbank_gruppe",
5333 VolkskreditbankAg => "volkskreditbank_ag",
5334 VrBankBraunau => "vr_bank_braunau",
5335 Unknown(v) => v,
5336 }
5337 }
5338}
5339
5340impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
5341 type Err = std::convert::Infallible;
5342 fn from_str(s: &str) -> Result<Self, Self::Err> {
5343 use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5344 match s {
5345 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
5346 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
5347 "bank_austria" => Ok(BankAustria),
5348 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
5349 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
5350 "bawag_psk_ag" => Ok(BawagPskAg),
5351 "bks_bank_ag" => Ok(BksBankAg),
5352 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
5353 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
5354 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
5355 "deutsche_bank_ag" => Ok(DeutscheBankAg),
5356 "dolomitenbank" => Ok(Dolomitenbank),
5357 "easybank_ag" => Ok(EasybankAg),
5358 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
5359 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
5360 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
5361 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
5362 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
5363 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
5364 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
5365 "marchfelder_bank" => Ok(MarchfelderBank),
5366 "oberbank_ag" => Ok(OberbankAg),
5367 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
5368 "schoellerbank_ag" => Ok(SchoellerbankAg),
5369 "sparda_bank_wien" => Ok(SpardaBankWien),
5370 "volksbank_gruppe" => Ok(VolksbankGruppe),
5371 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
5372 "vr_bank_braunau" => Ok(VrBankBraunau),
5373 v => {
5374 tracing::warn!(
5375 "Unknown value '{}' for enum '{}'",
5376 v,
5377 "UpdateSetupIntentPaymentMethodDataEpsBank"
5378 );
5379 Ok(Unknown(v.to_owned()))
5380 }
5381 }
5382 }
5383}
5384impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
5385 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5386 f.write_str(self.as_str())
5387 }
5388}
5389
5390impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
5391 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5392 f.write_str(self.as_str())
5393 }
5394}
5395impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
5396 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5397 where
5398 S: serde::Serializer,
5399 {
5400 serializer.serialize_str(self.as_str())
5401 }
5402}
5403#[cfg(feature = "deserialize")]
5404impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
5405 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5406 use std::str::FromStr;
5407 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5408 Ok(Self::from_str(&s).expect("infallible"))
5409 }
5410}
5411#[derive(Clone, Debug, serde::Serialize)]
5413pub struct UpdateSetupIntentPaymentMethodDataFpx {
5414 #[serde(skip_serializing_if = "Option::is_none")]
5416 pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
5417 pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
5419}
5420impl UpdateSetupIntentPaymentMethodDataFpx {
5421 pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
5422 Self { account_holder_type: None, bank: bank.into() }
5423 }
5424}
5425#[derive(Clone, Eq, PartialEq)]
5427#[non_exhaustive]
5428pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5429 Company,
5430 Individual,
5431 Unknown(String),
5433}
5434impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5435 pub fn as_str(&self) -> &str {
5436 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5437 match self {
5438 Company => "company",
5439 Individual => "individual",
5440 Unknown(v) => v,
5441 }
5442 }
5443}
5444
5445impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5446 type Err = std::convert::Infallible;
5447 fn from_str(s: &str) -> Result<Self, Self::Err> {
5448 use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5449 match s {
5450 "company" => Ok(Company),
5451 "individual" => Ok(Individual),
5452 v => {
5453 tracing::warn!(
5454 "Unknown value '{}' for enum '{}'",
5455 v,
5456 "UpdateSetupIntentPaymentMethodDataFpxAccountHolderType"
5457 );
5458 Ok(Unknown(v.to_owned()))
5459 }
5460 }
5461 }
5462}
5463impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5464 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5465 f.write_str(self.as_str())
5466 }
5467}
5468
5469impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5470 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5471 f.write_str(self.as_str())
5472 }
5473}
5474impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5475 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5476 where
5477 S: serde::Serializer,
5478 {
5479 serializer.serialize_str(self.as_str())
5480 }
5481}
5482#[cfg(feature = "deserialize")]
5483impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5484 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5485 use std::str::FromStr;
5486 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5487 Ok(Self::from_str(&s).expect("infallible"))
5488 }
5489}
5490#[derive(Clone, Eq, PartialEq)]
5492#[non_exhaustive]
5493pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
5494 AffinBank,
5495 Agrobank,
5496 AllianceBank,
5497 Ambank,
5498 BankIslam,
5499 BankMuamalat,
5500 BankOfChina,
5501 BankRakyat,
5502 Bsn,
5503 Cimb,
5504 DeutscheBank,
5505 HongLeongBank,
5506 Hsbc,
5507 Kfh,
5508 Maybank2e,
5509 Maybank2u,
5510 Ocbc,
5511 PbEnterprise,
5512 PublicBank,
5513 Rhb,
5514 StandardChartered,
5515 Uob,
5516 Unknown(String),
5518}
5519impl UpdateSetupIntentPaymentMethodDataFpxBank {
5520 pub fn as_str(&self) -> &str {
5521 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5522 match self {
5523 AffinBank => "affin_bank",
5524 Agrobank => "agrobank",
5525 AllianceBank => "alliance_bank",
5526 Ambank => "ambank",
5527 BankIslam => "bank_islam",
5528 BankMuamalat => "bank_muamalat",
5529 BankOfChina => "bank_of_china",
5530 BankRakyat => "bank_rakyat",
5531 Bsn => "bsn",
5532 Cimb => "cimb",
5533 DeutscheBank => "deutsche_bank",
5534 HongLeongBank => "hong_leong_bank",
5535 Hsbc => "hsbc",
5536 Kfh => "kfh",
5537 Maybank2e => "maybank2e",
5538 Maybank2u => "maybank2u",
5539 Ocbc => "ocbc",
5540 PbEnterprise => "pb_enterprise",
5541 PublicBank => "public_bank",
5542 Rhb => "rhb",
5543 StandardChartered => "standard_chartered",
5544 Uob => "uob",
5545 Unknown(v) => v,
5546 }
5547 }
5548}
5549
5550impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
5551 type Err = std::convert::Infallible;
5552 fn from_str(s: &str) -> Result<Self, Self::Err> {
5553 use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5554 match s {
5555 "affin_bank" => Ok(AffinBank),
5556 "agrobank" => Ok(Agrobank),
5557 "alliance_bank" => Ok(AllianceBank),
5558 "ambank" => Ok(Ambank),
5559 "bank_islam" => Ok(BankIslam),
5560 "bank_muamalat" => Ok(BankMuamalat),
5561 "bank_of_china" => Ok(BankOfChina),
5562 "bank_rakyat" => Ok(BankRakyat),
5563 "bsn" => Ok(Bsn),
5564 "cimb" => Ok(Cimb),
5565 "deutsche_bank" => Ok(DeutscheBank),
5566 "hong_leong_bank" => Ok(HongLeongBank),
5567 "hsbc" => Ok(Hsbc),
5568 "kfh" => Ok(Kfh),
5569 "maybank2e" => Ok(Maybank2e),
5570 "maybank2u" => Ok(Maybank2u),
5571 "ocbc" => Ok(Ocbc),
5572 "pb_enterprise" => Ok(PbEnterprise),
5573 "public_bank" => Ok(PublicBank),
5574 "rhb" => Ok(Rhb),
5575 "standard_chartered" => Ok(StandardChartered),
5576 "uob" => Ok(Uob),
5577 v => {
5578 tracing::warn!(
5579 "Unknown value '{}' for enum '{}'",
5580 v,
5581 "UpdateSetupIntentPaymentMethodDataFpxBank"
5582 );
5583 Ok(Unknown(v.to_owned()))
5584 }
5585 }
5586 }
5587}
5588impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
5589 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5590 f.write_str(self.as_str())
5591 }
5592}
5593
5594impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
5595 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5596 f.write_str(self.as_str())
5597 }
5598}
5599impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
5600 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5601 where
5602 S: serde::Serializer,
5603 {
5604 serializer.serialize_str(self.as_str())
5605 }
5606}
5607#[cfg(feature = "deserialize")]
5608impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
5609 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5610 use std::str::FromStr;
5611 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5612 Ok(Self::from_str(&s).expect("infallible"))
5613 }
5614}
5615#[derive(Clone, Debug, serde::Serialize)]
5617pub struct UpdateSetupIntentPaymentMethodDataIdeal {
5618 #[serde(skip_serializing_if = "Option::is_none")]
5622 pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
5623}
5624impl UpdateSetupIntentPaymentMethodDataIdeal {
5625 pub fn new() -> Self {
5626 Self { bank: None }
5627 }
5628}
5629impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
5630 fn default() -> Self {
5631 Self::new()
5632 }
5633}
5634#[derive(Clone, Eq, PartialEq)]
5638#[non_exhaustive]
5639pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
5640 AbnAmro,
5641 AsnBank,
5642 Bunq,
5643 Buut,
5644 Finom,
5645 Handelsbanken,
5646 Ing,
5647 Knab,
5648 Moneyou,
5649 N26,
5650 Nn,
5651 Rabobank,
5652 Regiobank,
5653 Revolut,
5654 SnsBank,
5655 TriodosBank,
5656 VanLanschot,
5657 Yoursafe,
5658 Unknown(String),
5660}
5661impl UpdateSetupIntentPaymentMethodDataIdealBank {
5662 pub fn as_str(&self) -> &str {
5663 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5664 match self {
5665 AbnAmro => "abn_amro",
5666 AsnBank => "asn_bank",
5667 Bunq => "bunq",
5668 Buut => "buut",
5669 Finom => "finom",
5670 Handelsbanken => "handelsbanken",
5671 Ing => "ing",
5672 Knab => "knab",
5673 Moneyou => "moneyou",
5674 N26 => "n26",
5675 Nn => "nn",
5676 Rabobank => "rabobank",
5677 Regiobank => "regiobank",
5678 Revolut => "revolut",
5679 SnsBank => "sns_bank",
5680 TriodosBank => "triodos_bank",
5681 VanLanschot => "van_lanschot",
5682 Yoursafe => "yoursafe",
5683 Unknown(v) => v,
5684 }
5685 }
5686}
5687
5688impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
5689 type Err = std::convert::Infallible;
5690 fn from_str(s: &str) -> Result<Self, Self::Err> {
5691 use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5692 match s {
5693 "abn_amro" => Ok(AbnAmro),
5694 "asn_bank" => Ok(AsnBank),
5695 "bunq" => Ok(Bunq),
5696 "buut" => Ok(Buut),
5697 "finom" => Ok(Finom),
5698 "handelsbanken" => Ok(Handelsbanken),
5699 "ing" => Ok(Ing),
5700 "knab" => Ok(Knab),
5701 "moneyou" => Ok(Moneyou),
5702 "n26" => Ok(N26),
5703 "nn" => Ok(Nn),
5704 "rabobank" => Ok(Rabobank),
5705 "regiobank" => Ok(Regiobank),
5706 "revolut" => Ok(Revolut),
5707 "sns_bank" => Ok(SnsBank),
5708 "triodos_bank" => Ok(TriodosBank),
5709 "van_lanschot" => Ok(VanLanschot),
5710 "yoursafe" => Ok(Yoursafe),
5711 v => {
5712 tracing::warn!(
5713 "Unknown value '{}' for enum '{}'",
5714 v,
5715 "UpdateSetupIntentPaymentMethodDataIdealBank"
5716 );
5717 Ok(Unknown(v.to_owned()))
5718 }
5719 }
5720 }
5721}
5722impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
5723 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5724 f.write_str(self.as_str())
5725 }
5726}
5727
5728impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
5729 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5730 f.write_str(self.as_str())
5731 }
5732}
5733impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
5734 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5735 where
5736 S: serde::Serializer,
5737 {
5738 serializer.serialize_str(self.as_str())
5739 }
5740}
5741#[cfg(feature = "deserialize")]
5742impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
5743 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5744 use std::str::FromStr;
5745 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5746 Ok(Self::from_str(&s).expect("infallible"))
5747 }
5748}
5749#[derive(Copy, Clone, Debug, serde::Serialize)]
5751pub struct UpdateSetupIntentPaymentMethodDataKlarna {
5752 #[serde(skip_serializing_if = "Option::is_none")]
5754 pub dob: Option<DateOfBirth>,
5755}
5756impl UpdateSetupIntentPaymentMethodDataKlarna {
5757 pub fn new() -> Self {
5758 Self { dob: None }
5759 }
5760}
5761impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
5762 fn default() -> Self {
5763 Self::new()
5764 }
5765}
5766#[derive(Clone, Debug, serde::Serialize)]
5768pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
5769 #[serde(skip_serializing_if = "Option::is_none")]
5772 pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
5773}
5774impl UpdateSetupIntentPaymentMethodDataNaverPay {
5775 pub fn new() -> Self {
5776 Self { funding: None }
5777 }
5778}
5779impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
5780 fn default() -> Self {
5781 Self::new()
5782 }
5783}
5784#[derive(Clone, Eq, PartialEq)]
5787#[non_exhaustive]
5788pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5789 Card,
5790 Points,
5791 Unknown(String),
5793}
5794impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5795 pub fn as_str(&self) -> &str {
5796 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5797 match self {
5798 Card => "card",
5799 Points => "points",
5800 Unknown(v) => v,
5801 }
5802 }
5803}
5804
5805impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5806 type Err = std::convert::Infallible;
5807 fn from_str(s: &str) -> Result<Self, Self::Err> {
5808 use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5809 match s {
5810 "card" => Ok(Card),
5811 "points" => Ok(Points),
5812 v => {
5813 tracing::warn!(
5814 "Unknown value '{}' for enum '{}'",
5815 v,
5816 "UpdateSetupIntentPaymentMethodDataNaverPayFunding"
5817 );
5818 Ok(Unknown(v.to_owned()))
5819 }
5820 }
5821 }
5822}
5823impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5824 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5825 f.write_str(self.as_str())
5826 }
5827}
5828
5829impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5830 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5831 f.write_str(self.as_str())
5832 }
5833}
5834impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5835 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5836 where
5837 S: serde::Serializer,
5838 {
5839 serializer.serialize_str(self.as_str())
5840 }
5841}
5842#[cfg(feature = "deserialize")]
5843impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5844 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5845 use std::str::FromStr;
5846 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5847 Ok(Self::from_str(&s).expect("infallible"))
5848 }
5849}
5850#[derive(Clone, Debug, serde::Serialize)]
5852pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
5853 #[serde(skip_serializing_if = "Option::is_none")]
5856 pub account_holder_name: Option<String>,
5857 pub account_number: String,
5859 pub bank_code: String,
5861 pub branch_code: String,
5863 #[serde(skip_serializing_if = "Option::is_none")]
5864 pub reference: Option<String>,
5865 pub suffix: String,
5867}
5868impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
5869 pub fn new(
5870 account_number: impl Into<String>,
5871 bank_code: impl Into<String>,
5872 branch_code: impl Into<String>,
5873 suffix: impl Into<String>,
5874 ) -> Self {
5875 Self {
5876 account_holder_name: None,
5877 account_number: account_number.into(),
5878 bank_code: bank_code.into(),
5879 branch_code: branch_code.into(),
5880 reference: None,
5881 suffix: suffix.into(),
5882 }
5883 }
5884}
5885#[derive(Clone, Debug, serde::Serialize)]
5887pub struct UpdateSetupIntentPaymentMethodDataP24 {
5888 #[serde(skip_serializing_if = "Option::is_none")]
5890 pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
5891}
5892impl UpdateSetupIntentPaymentMethodDataP24 {
5893 pub fn new() -> Self {
5894 Self { bank: None }
5895 }
5896}
5897impl Default for UpdateSetupIntentPaymentMethodDataP24 {
5898 fn default() -> Self {
5899 Self::new()
5900 }
5901}
5902#[derive(Clone, Eq, PartialEq)]
5904#[non_exhaustive]
5905pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
5906 AliorBank,
5907 BankMillennium,
5908 BankNowyBfgSa,
5909 BankPekaoSa,
5910 BankiSpbdzielcze,
5911 Blik,
5912 BnpParibas,
5913 Boz,
5914 CitiHandlowy,
5915 CreditAgricole,
5916 Envelobank,
5917 EtransferPocztowy24,
5918 GetinBank,
5919 Ideabank,
5920 Ing,
5921 Inteligo,
5922 MbankMtransfer,
5923 NestPrzelew,
5924 NoblePay,
5925 PbacZIpko,
5926 PlusBank,
5927 SantanderPrzelew24,
5928 TmobileUsbugiBankowe,
5929 ToyotaBank,
5930 Velobank,
5931 VolkswagenBank,
5932 Unknown(String),
5934}
5935impl UpdateSetupIntentPaymentMethodDataP24Bank {
5936 pub fn as_str(&self) -> &str {
5937 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5938 match self {
5939 AliorBank => "alior_bank",
5940 BankMillennium => "bank_millennium",
5941 BankNowyBfgSa => "bank_nowy_bfg_sa",
5942 BankPekaoSa => "bank_pekao_sa",
5943 BankiSpbdzielcze => "banki_spbdzielcze",
5944 Blik => "blik",
5945 BnpParibas => "bnp_paribas",
5946 Boz => "boz",
5947 CitiHandlowy => "citi_handlowy",
5948 CreditAgricole => "credit_agricole",
5949 Envelobank => "envelobank",
5950 EtransferPocztowy24 => "etransfer_pocztowy24",
5951 GetinBank => "getin_bank",
5952 Ideabank => "ideabank",
5953 Ing => "ing",
5954 Inteligo => "inteligo",
5955 MbankMtransfer => "mbank_mtransfer",
5956 NestPrzelew => "nest_przelew",
5957 NoblePay => "noble_pay",
5958 PbacZIpko => "pbac_z_ipko",
5959 PlusBank => "plus_bank",
5960 SantanderPrzelew24 => "santander_przelew24",
5961 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
5962 ToyotaBank => "toyota_bank",
5963 Velobank => "velobank",
5964 VolkswagenBank => "volkswagen_bank",
5965 Unknown(v) => v,
5966 }
5967 }
5968}
5969
5970impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
5971 type Err = std::convert::Infallible;
5972 fn from_str(s: &str) -> Result<Self, Self::Err> {
5973 use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5974 match s {
5975 "alior_bank" => Ok(AliorBank),
5976 "bank_millennium" => Ok(BankMillennium),
5977 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
5978 "bank_pekao_sa" => Ok(BankPekaoSa),
5979 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
5980 "blik" => Ok(Blik),
5981 "bnp_paribas" => Ok(BnpParibas),
5982 "boz" => Ok(Boz),
5983 "citi_handlowy" => Ok(CitiHandlowy),
5984 "credit_agricole" => Ok(CreditAgricole),
5985 "envelobank" => Ok(Envelobank),
5986 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
5987 "getin_bank" => Ok(GetinBank),
5988 "ideabank" => Ok(Ideabank),
5989 "ing" => Ok(Ing),
5990 "inteligo" => Ok(Inteligo),
5991 "mbank_mtransfer" => Ok(MbankMtransfer),
5992 "nest_przelew" => Ok(NestPrzelew),
5993 "noble_pay" => Ok(NoblePay),
5994 "pbac_z_ipko" => Ok(PbacZIpko),
5995 "plus_bank" => Ok(PlusBank),
5996 "santander_przelew24" => Ok(SantanderPrzelew24),
5997 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
5998 "toyota_bank" => Ok(ToyotaBank),
5999 "velobank" => Ok(Velobank),
6000 "volkswagen_bank" => Ok(VolkswagenBank),
6001 v => {
6002 tracing::warn!(
6003 "Unknown value '{}' for enum '{}'",
6004 v,
6005 "UpdateSetupIntentPaymentMethodDataP24Bank"
6006 );
6007 Ok(Unknown(v.to_owned()))
6008 }
6009 }
6010 }
6011}
6012impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
6013 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6014 f.write_str(self.as_str())
6015 }
6016}
6017
6018impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
6019 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6020 f.write_str(self.as_str())
6021 }
6022}
6023impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
6024 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6025 where
6026 S: serde::Serializer,
6027 {
6028 serializer.serialize_str(self.as_str())
6029 }
6030}
6031#[cfg(feature = "deserialize")]
6032impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
6033 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6034 use std::str::FromStr;
6035 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6036 Ok(Self::from_str(&s).expect("infallible"))
6037 }
6038}
6039#[derive(Clone, Debug, serde::Serialize)]
6041pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
6042 pub iban: String,
6044}
6045impl UpdateSetupIntentPaymentMethodDataSepaDebit {
6046 pub fn new(iban: impl Into<String>) -> Self {
6047 Self { iban: iban.into() }
6048 }
6049}
6050#[derive(Clone, Debug, serde::Serialize)]
6052pub struct UpdateSetupIntentPaymentMethodDataSofort {
6053 pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
6055}
6056impl UpdateSetupIntentPaymentMethodDataSofort {
6057 pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
6058 Self { country: country.into() }
6059 }
6060}
6061#[derive(Clone, Eq, PartialEq)]
6063#[non_exhaustive]
6064pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
6065 At,
6066 Be,
6067 De,
6068 Es,
6069 It,
6070 Nl,
6071 Unknown(String),
6073}
6074impl UpdateSetupIntentPaymentMethodDataSofortCountry {
6075 pub fn as_str(&self) -> &str {
6076 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
6077 match self {
6078 At => "AT",
6079 Be => "BE",
6080 De => "DE",
6081 Es => "ES",
6082 It => "IT",
6083 Nl => "NL",
6084 Unknown(v) => v,
6085 }
6086 }
6087}
6088
6089impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
6090 type Err = std::convert::Infallible;
6091 fn from_str(s: &str) -> Result<Self, Self::Err> {
6092 use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
6093 match s {
6094 "AT" => Ok(At),
6095 "BE" => Ok(Be),
6096 "DE" => Ok(De),
6097 "ES" => Ok(Es),
6098 "IT" => Ok(It),
6099 "NL" => Ok(Nl),
6100 v => {
6101 tracing::warn!(
6102 "Unknown value '{}' for enum '{}'",
6103 v,
6104 "UpdateSetupIntentPaymentMethodDataSofortCountry"
6105 );
6106 Ok(Unknown(v.to_owned()))
6107 }
6108 }
6109 }
6110}
6111impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
6112 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6113 f.write_str(self.as_str())
6114 }
6115}
6116
6117impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
6118 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6119 f.write_str(self.as_str())
6120 }
6121}
6122impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
6123 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6124 where
6125 S: serde::Serializer,
6126 {
6127 serializer.serialize_str(self.as_str())
6128 }
6129}
6130#[cfg(feature = "deserialize")]
6131impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
6132 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6133 use std::str::FromStr;
6134 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6135 Ok(Self::from_str(&s).expect("infallible"))
6136 }
6137}
6138#[derive(Clone, Eq, PartialEq)]
6142#[non_exhaustive]
6143pub enum UpdateSetupIntentPaymentMethodDataType {
6144 AcssDebit,
6145 Affirm,
6146 AfterpayClearpay,
6147 Alipay,
6148 Alma,
6149 AmazonPay,
6150 AuBecsDebit,
6151 BacsDebit,
6152 Bancontact,
6153 Billie,
6154 Blik,
6155 Boleto,
6156 Cashapp,
6157 Crypto,
6158 CustomerBalance,
6159 Eps,
6160 Fpx,
6161 Giropay,
6162 Grabpay,
6163 Ideal,
6164 KakaoPay,
6165 Klarna,
6166 Konbini,
6167 KrCard,
6168 Link,
6169 MbWay,
6170 Mobilepay,
6171 Multibanco,
6172 NaverPay,
6173 NzBankAccount,
6174 Oxxo,
6175 P24,
6176 PayByBank,
6177 Payco,
6178 Paynow,
6179 Paypal,
6180 Pix,
6181 Promptpay,
6182 RevolutPay,
6183 SamsungPay,
6184 Satispay,
6185 SepaDebit,
6186 Sofort,
6187 Swish,
6188 Twint,
6189 UsBankAccount,
6190 WechatPay,
6191 Zip,
6192 Unknown(String),
6194}
6195impl UpdateSetupIntentPaymentMethodDataType {
6196 pub fn as_str(&self) -> &str {
6197 use UpdateSetupIntentPaymentMethodDataType::*;
6198 match self {
6199 AcssDebit => "acss_debit",
6200 Affirm => "affirm",
6201 AfterpayClearpay => "afterpay_clearpay",
6202 Alipay => "alipay",
6203 Alma => "alma",
6204 AmazonPay => "amazon_pay",
6205 AuBecsDebit => "au_becs_debit",
6206 BacsDebit => "bacs_debit",
6207 Bancontact => "bancontact",
6208 Billie => "billie",
6209 Blik => "blik",
6210 Boleto => "boleto",
6211 Cashapp => "cashapp",
6212 Crypto => "crypto",
6213 CustomerBalance => "customer_balance",
6214 Eps => "eps",
6215 Fpx => "fpx",
6216 Giropay => "giropay",
6217 Grabpay => "grabpay",
6218 Ideal => "ideal",
6219 KakaoPay => "kakao_pay",
6220 Klarna => "klarna",
6221 Konbini => "konbini",
6222 KrCard => "kr_card",
6223 Link => "link",
6224 MbWay => "mb_way",
6225 Mobilepay => "mobilepay",
6226 Multibanco => "multibanco",
6227 NaverPay => "naver_pay",
6228 NzBankAccount => "nz_bank_account",
6229 Oxxo => "oxxo",
6230 P24 => "p24",
6231 PayByBank => "pay_by_bank",
6232 Payco => "payco",
6233 Paynow => "paynow",
6234 Paypal => "paypal",
6235 Pix => "pix",
6236 Promptpay => "promptpay",
6237 RevolutPay => "revolut_pay",
6238 SamsungPay => "samsung_pay",
6239 Satispay => "satispay",
6240 SepaDebit => "sepa_debit",
6241 Sofort => "sofort",
6242 Swish => "swish",
6243 Twint => "twint",
6244 UsBankAccount => "us_bank_account",
6245 WechatPay => "wechat_pay",
6246 Zip => "zip",
6247 Unknown(v) => v,
6248 }
6249 }
6250}
6251
6252impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
6253 type Err = std::convert::Infallible;
6254 fn from_str(s: &str) -> Result<Self, Self::Err> {
6255 use UpdateSetupIntentPaymentMethodDataType::*;
6256 match s {
6257 "acss_debit" => Ok(AcssDebit),
6258 "affirm" => Ok(Affirm),
6259 "afterpay_clearpay" => Ok(AfterpayClearpay),
6260 "alipay" => Ok(Alipay),
6261 "alma" => Ok(Alma),
6262 "amazon_pay" => Ok(AmazonPay),
6263 "au_becs_debit" => Ok(AuBecsDebit),
6264 "bacs_debit" => Ok(BacsDebit),
6265 "bancontact" => Ok(Bancontact),
6266 "billie" => Ok(Billie),
6267 "blik" => Ok(Blik),
6268 "boleto" => Ok(Boleto),
6269 "cashapp" => Ok(Cashapp),
6270 "crypto" => Ok(Crypto),
6271 "customer_balance" => Ok(CustomerBalance),
6272 "eps" => Ok(Eps),
6273 "fpx" => Ok(Fpx),
6274 "giropay" => Ok(Giropay),
6275 "grabpay" => Ok(Grabpay),
6276 "ideal" => Ok(Ideal),
6277 "kakao_pay" => Ok(KakaoPay),
6278 "klarna" => Ok(Klarna),
6279 "konbini" => Ok(Konbini),
6280 "kr_card" => Ok(KrCard),
6281 "link" => Ok(Link),
6282 "mb_way" => Ok(MbWay),
6283 "mobilepay" => Ok(Mobilepay),
6284 "multibanco" => Ok(Multibanco),
6285 "naver_pay" => Ok(NaverPay),
6286 "nz_bank_account" => Ok(NzBankAccount),
6287 "oxxo" => Ok(Oxxo),
6288 "p24" => Ok(P24),
6289 "pay_by_bank" => Ok(PayByBank),
6290 "payco" => Ok(Payco),
6291 "paynow" => Ok(Paynow),
6292 "paypal" => Ok(Paypal),
6293 "pix" => Ok(Pix),
6294 "promptpay" => Ok(Promptpay),
6295 "revolut_pay" => Ok(RevolutPay),
6296 "samsung_pay" => Ok(SamsungPay),
6297 "satispay" => Ok(Satispay),
6298 "sepa_debit" => Ok(SepaDebit),
6299 "sofort" => Ok(Sofort),
6300 "swish" => Ok(Swish),
6301 "twint" => Ok(Twint),
6302 "us_bank_account" => Ok(UsBankAccount),
6303 "wechat_pay" => Ok(WechatPay),
6304 "zip" => Ok(Zip),
6305 v => {
6306 tracing::warn!(
6307 "Unknown value '{}' for enum '{}'",
6308 v,
6309 "UpdateSetupIntentPaymentMethodDataType"
6310 );
6311 Ok(Unknown(v.to_owned()))
6312 }
6313 }
6314 }
6315}
6316impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
6317 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6318 f.write_str(self.as_str())
6319 }
6320}
6321
6322impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
6323 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6324 f.write_str(self.as_str())
6325 }
6326}
6327impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
6328 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6329 where
6330 S: serde::Serializer,
6331 {
6332 serializer.serialize_str(self.as_str())
6333 }
6334}
6335#[cfg(feature = "deserialize")]
6336impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
6337 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6338 use std::str::FromStr;
6339 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6340 Ok(Self::from_str(&s).expect("infallible"))
6341 }
6342}
6343#[derive(Clone, Debug, serde::Serialize)]
6345pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
6346 #[serde(skip_serializing_if = "Option::is_none")]
6348 pub account_holder_type:
6349 Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
6350 #[serde(skip_serializing_if = "Option::is_none")]
6352 pub account_number: Option<String>,
6353 #[serde(skip_serializing_if = "Option::is_none")]
6355 pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
6356 #[serde(skip_serializing_if = "Option::is_none")]
6358 pub financial_connections_account: Option<String>,
6359 #[serde(skip_serializing_if = "Option::is_none")]
6361 pub routing_number: Option<String>,
6362}
6363impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
6364 pub fn new() -> Self {
6365 Self {
6366 account_holder_type: None,
6367 account_number: None,
6368 account_type: None,
6369 financial_connections_account: None,
6370 routing_number: None,
6371 }
6372 }
6373}
6374impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
6375 fn default() -> Self {
6376 Self::new()
6377 }
6378}
6379#[derive(Clone, Eq, PartialEq)]
6381#[non_exhaustive]
6382pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6383 Company,
6384 Individual,
6385 Unknown(String),
6387}
6388impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6389 pub fn as_str(&self) -> &str {
6390 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6391 match self {
6392 Company => "company",
6393 Individual => "individual",
6394 Unknown(v) => v,
6395 }
6396 }
6397}
6398
6399impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6400 type Err = std::convert::Infallible;
6401 fn from_str(s: &str) -> Result<Self, Self::Err> {
6402 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6403 match s {
6404 "company" => Ok(Company),
6405 "individual" => Ok(Individual),
6406 v => {
6407 tracing::warn!(
6408 "Unknown value '{}' for enum '{}'",
6409 v,
6410 "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
6411 );
6412 Ok(Unknown(v.to_owned()))
6413 }
6414 }
6415 }
6416}
6417impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6418 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6419 f.write_str(self.as_str())
6420 }
6421}
6422
6423impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6424 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6425 f.write_str(self.as_str())
6426 }
6427}
6428impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6429 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6430 where
6431 S: serde::Serializer,
6432 {
6433 serializer.serialize_str(self.as_str())
6434 }
6435}
6436#[cfg(feature = "deserialize")]
6437impl<'de> serde::Deserialize<'de>
6438 for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
6439{
6440 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6441 use std::str::FromStr;
6442 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6443 Ok(Self::from_str(&s).expect("infallible"))
6444 }
6445}
6446#[derive(Clone, Eq, PartialEq)]
6448#[non_exhaustive]
6449pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6450 Checking,
6451 Savings,
6452 Unknown(String),
6454}
6455impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6456 pub fn as_str(&self) -> &str {
6457 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6458 match self {
6459 Checking => "checking",
6460 Savings => "savings",
6461 Unknown(v) => v,
6462 }
6463 }
6464}
6465
6466impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6467 type Err = std::convert::Infallible;
6468 fn from_str(s: &str) -> Result<Self, Self::Err> {
6469 use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6470 match s {
6471 "checking" => Ok(Checking),
6472 "savings" => Ok(Savings),
6473 v => {
6474 tracing::warn!(
6475 "Unknown value '{}' for enum '{}'",
6476 v,
6477 "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType"
6478 );
6479 Ok(Unknown(v.to_owned()))
6480 }
6481 }
6482 }
6483}
6484impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6485 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6486 f.write_str(self.as_str())
6487 }
6488}
6489
6490impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6491 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6492 f.write_str(self.as_str())
6493 }
6494}
6495impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6496 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6497 where
6498 S: serde::Serializer,
6499 {
6500 serializer.serialize_str(self.as_str())
6501 }
6502}
6503#[cfg(feature = "deserialize")]
6504impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6505 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6506 use std::str::FromStr;
6507 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6508 Ok(Self::from_str(&s).expect("infallible"))
6509 }
6510}
6511#[derive(Clone, Debug, serde::Serialize)]
6513pub struct UpdateSetupIntentPaymentMethodOptions {
6514 #[serde(skip_serializing_if = "Option::is_none")]
6516 pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
6517 #[serde(skip_serializing_if = "Option::is_none")]
6519 #[serde(with = "stripe_types::with_serde_json_opt")]
6520 pub amazon_pay: Option<miniserde::json::Value>,
6521 #[serde(skip_serializing_if = "Option::is_none")]
6523 pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
6524 #[serde(skip_serializing_if = "Option::is_none")]
6526 pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
6527 #[serde(skip_serializing_if = "Option::is_none")]
6529 #[serde(with = "stripe_types::with_serde_json_opt")]
6530 pub card_present: Option<miniserde::json::Value>,
6531 #[serde(skip_serializing_if = "Option::is_none")]
6533 pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
6534 #[serde(skip_serializing_if = "Option::is_none")]
6536 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
6537 #[serde(skip_serializing_if = "Option::is_none")]
6539 pub paypal: Option<PaymentMethodOptionsParam>,
6540 #[serde(skip_serializing_if = "Option::is_none")]
6542 pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
6543 #[serde(skip_serializing_if = "Option::is_none")]
6545 pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
6546}
6547impl UpdateSetupIntentPaymentMethodOptions {
6548 pub fn new() -> Self {
6549 Self {
6550 acss_debit: None,
6551 amazon_pay: None,
6552 bacs_debit: None,
6553 card: None,
6554 card_present: None,
6555 klarna: None,
6556 link: None,
6557 paypal: None,
6558 sepa_debit: None,
6559 us_bank_account: None,
6560 }
6561 }
6562}
6563impl Default for UpdateSetupIntentPaymentMethodOptions {
6564 fn default() -> Self {
6565 Self::new()
6566 }
6567}
6568#[derive(Clone, Debug, serde::Serialize)]
6570pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6571 #[serde(skip_serializing_if = "Option::is_none")]
6574 pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
6575 #[serde(skip_serializing_if = "Option::is_none")]
6577 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
6578 #[serde(skip_serializing_if = "Option::is_none")]
6580 pub verification_method:
6581 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
6582}
6583impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6584 pub fn new() -> Self {
6585 Self { currency: None, mandate_options: None, verification_method: None }
6586 }
6587}
6588impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6589 fn default() -> Self {
6590 Self::new()
6591 }
6592}
6593#[derive(Clone, Eq, PartialEq)]
6596#[non_exhaustive]
6597pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6598 Cad,
6599 Usd,
6600 Unknown(String),
6602}
6603impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6604 pub fn as_str(&self) -> &str {
6605 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6606 match self {
6607 Cad => "cad",
6608 Usd => "usd",
6609 Unknown(v) => v,
6610 }
6611 }
6612}
6613
6614impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6615 type Err = std::convert::Infallible;
6616 fn from_str(s: &str) -> Result<Self, Self::Err> {
6617 use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6618 match s {
6619 "cad" => Ok(Cad),
6620 "usd" => Ok(Usd),
6621 v => {
6622 tracing::warn!(
6623 "Unknown value '{}' for enum '{}'",
6624 v,
6625 "UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
6626 );
6627 Ok(Unknown(v.to_owned()))
6628 }
6629 }
6630 }
6631}
6632impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6633 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6634 f.write_str(self.as_str())
6635 }
6636}
6637
6638impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6639 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6640 f.write_str(self.as_str())
6641 }
6642}
6643impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6644 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6645 where
6646 S: serde::Serializer,
6647 {
6648 serializer.serialize_str(self.as_str())
6649 }
6650}
6651#[cfg(feature = "deserialize")]
6652impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6653 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6654 use std::str::FromStr;
6655 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6656 Ok(Self::from_str(&s).expect("infallible"))
6657 }
6658}
6659#[derive(Clone, Debug, serde::Serialize)]
6661pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6662 #[serde(skip_serializing_if = "Option::is_none")]
6666 pub custom_mandate_url: Option<String>,
6667 #[serde(skip_serializing_if = "Option::is_none")]
6669 pub default_for:
6670 Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
6671 #[serde(skip_serializing_if = "Option::is_none")]
6674 pub interval_description: Option<String>,
6675 #[serde(skip_serializing_if = "Option::is_none")]
6677 pub payment_schedule:
6678 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
6679 #[serde(skip_serializing_if = "Option::is_none")]
6681 pub transaction_type:
6682 Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
6683}
6684impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6685 pub fn new() -> Self {
6686 Self {
6687 custom_mandate_url: None,
6688 default_for: None,
6689 interval_description: None,
6690 payment_schedule: None,
6691 transaction_type: None,
6692 }
6693 }
6694}
6695impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6696 fn default() -> Self {
6697 Self::new()
6698 }
6699}
6700#[derive(Clone, Eq, PartialEq)]
6702#[non_exhaustive]
6703pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6704 Invoice,
6705 Subscription,
6706 Unknown(String),
6708}
6709impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6710 pub fn as_str(&self) -> &str {
6711 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6712 match self {
6713 Invoice => "invoice",
6714 Subscription => "subscription",
6715 Unknown(v) => v,
6716 }
6717 }
6718}
6719
6720impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6721 type Err = std::convert::Infallible;
6722 fn from_str(s: &str) -> Result<Self, Self::Err> {
6723 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6724 match s {
6725 "invoice" => Ok(Invoice),
6726 "subscription" => Ok(Subscription),
6727 v => {
6728 tracing::warn!(
6729 "Unknown value '{}' for enum '{}'",
6730 v,
6731 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
6732 );
6733 Ok(Unknown(v.to_owned()))
6734 }
6735 }
6736 }
6737}
6738impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6739 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6740 f.write_str(self.as_str())
6741 }
6742}
6743
6744impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6745 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6746 f.write_str(self.as_str())
6747 }
6748}
6749impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6750 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6751 where
6752 S: serde::Serializer,
6753 {
6754 serializer.serialize_str(self.as_str())
6755 }
6756}
6757#[cfg(feature = "deserialize")]
6758impl<'de> serde::Deserialize<'de>
6759 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
6760{
6761 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6762 use std::str::FromStr;
6763 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6764 Ok(Self::from_str(&s).expect("infallible"))
6765 }
6766}
6767#[derive(Clone, Eq, PartialEq)]
6769#[non_exhaustive]
6770pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6771 Combined,
6772 Interval,
6773 Sporadic,
6774 Unknown(String),
6776}
6777impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6778 pub fn as_str(&self) -> &str {
6779 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6780 match self {
6781 Combined => "combined",
6782 Interval => "interval",
6783 Sporadic => "sporadic",
6784 Unknown(v) => v,
6785 }
6786 }
6787}
6788
6789impl std::str::FromStr
6790 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6791{
6792 type Err = std::convert::Infallible;
6793 fn from_str(s: &str) -> Result<Self, Self::Err> {
6794 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6795 match s {
6796 "combined" => Ok(Combined),
6797 "interval" => Ok(Interval),
6798 "sporadic" => Ok(Sporadic),
6799 v => {
6800 tracing::warn!(
6801 "Unknown value '{}' for enum '{}'",
6802 v,
6803 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
6804 );
6805 Ok(Unknown(v.to_owned()))
6806 }
6807 }
6808 }
6809}
6810impl std::fmt::Display
6811 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6812{
6813 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6814 f.write_str(self.as_str())
6815 }
6816}
6817
6818impl std::fmt::Debug
6819 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6820{
6821 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6822 f.write_str(self.as_str())
6823 }
6824}
6825impl serde::Serialize
6826 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6827{
6828 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6829 where
6830 S: serde::Serializer,
6831 {
6832 serializer.serialize_str(self.as_str())
6833 }
6834}
6835#[cfg(feature = "deserialize")]
6836impl<'de> serde::Deserialize<'de>
6837 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6838{
6839 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6840 use std::str::FromStr;
6841 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6842 Ok(Self::from_str(&s).expect("infallible"))
6843 }
6844}
6845#[derive(Clone, Eq, PartialEq)]
6847#[non_exhaustive]
6848pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6849 Business,
6850 Personal,
6851 Unknown(String),
6853}
6854impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6855 pub fn as_str(&self) -> &str {
6856 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6857 match self {
6858 Business => "business",
6859 Personal => "personal",
6860 Unknown(v) => v,
6861 }
6862 }
6863}
6864
6865impl std::str::FromStr
6866 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6867{
6868 type Err = std::convert::Infallible;
6869 fn from_str(s: &str) -> Result<Self, Self::Err> {
6870 use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6871 match s {
6872 "business" => Ok(Business),
6873 "personal" => Ok(Personal),
6874 v => {
6875 tracing::warn!(
6876 "Unknown value '{}' for enum '{}'",
6877 v,
6878 "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
6879 );
6880 Ok(Unknown(v.to_owned()))
6881 }
6882 }
6883 }
6884}
6885impl std::fmt::Display
6886 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6887{
6888 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6889 f.write_str(self.as_str())
6890 }
6891}
6892
6893impl std::fmt::Debug
6894 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6895{
6896 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6897 f.write_str(self.as_str())
6898 }
6899}
6900impl serde::Serialize
6901 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6902{
6903 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6904 where
6905 S: serde::Serializer,
6906 {
6907 serializer.serialize_str(self.as_str())
6908 }
6909}
6910#[cfg(feature = "deserialize")]
6911impl<'de> serde::Deserialize<'de>
6912 for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6913{
6914 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6915 use std::str::FromStr;
6916 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6917 Ok(Self::from_str(&s).expect("infallible"))
6918 }
6919}
6920#[derive(Clone, Eq, PartialEq)]
6922#[non_exhaustive]
6923pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6924 Automatic,
6925 Instant,
6926 Microdeposits,
6927 Unknown(String),
6929}
6930impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6931 pub fn as_str(&self) -> &str {
6932 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6933 match self {
6934 Automatic => "automatic",
6935 Instant => "instant",
6936 Microdeposits => "microdeposits",
6937 Unknown(v) => v,
6938 }
6939 }
6940}
6941
6942impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6943 type Err = std::convert::Infallible;
6944 fn from_str(s: &str) -> Result<Self, Self::Err> {
6945 use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6946 match s {
6947 "automatic" => Ok(Automatic),
6948 "instant" => Ok(Instant),
6949 "microdeposits" => Ok(Microdeposits),
6950 v => {
6951 tracing::warn!(
6952 "Unknown value '{}' for enum '{}'",
6953 v,
6954 "UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
6955 );
6956 Ok(Unknown(v.to_owned()))
6957 }
6958 }
6959 }
6960}
6961impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6962 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6963 f.write_str(self.as_str())
6964 }
6965}
6966
6967impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6968 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6969 f.write_str(self.as_str())
6970 }
6971}
6972impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6973 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6974 where
6975 S: serde::Serializer,
6976 {
6977 serializer.serialize_str(self.as_str())
6978 }
6979}
6980#[cfg(feature = "deserialize")]
6981impl<'de> serde::Deserialize<'de>
6982 for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
6983{
6984 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6985 use std::str::FromStr;
6986 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6987 Ok(Self::from_str(&s).expect("infallible"))
6988 }
6989}
6990#[derive(Clone, Debug, serde::Serialize)]
6992pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6993 #[serde(skip_serializing_if = "Option::is_none")]
6995 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
6996}
6997impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6998 pub fn new() -> Self {
6999 Self { mandate_options: None }
7000 }
7001}
7002impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
7003 fn default() -> Self {
7004 Self::new()
7005 }
7006}
7007#[derive(Clone, Debug, serde::Serialize)]
7009pub struct UpdateSetupIntentPaymentMethodOptionsCard {
7010 #[serde(skip_serializing_if = "Option::is_none")]
7012 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
7013 #[serde(skip_serializing_if = "Option::is_none")]
7017 pub moto: Option<bool>,
7018 #[serde(skip_serializing_if = "Option::is_none")]
7022 pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
7023 #[serde(skip_serializing_if = "Option::is_none")]
7028 pub request_three_d_secure:
7029 Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
7030 #[serde(skip_serializing_if = "Option::is_none")]
7033 pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
7034}
7035impl UpdateSetupIntentPaymentMethodOptionsCard {
7036 pub fn new() -> Self {
7037 Self {
7038 mandate_options: None,
7039 moto: None,
7040 network: None,
7041 request_three_d_secure: None,
7042 three_d_secure: None,
7043 }
7044 }
7045}
7046impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
7047 fn default() -> Self {
7048 Self::new()
7049 }
7050}
7051#[derive(Clone, Debug, serde::Serialize)]
7053pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
7054 pub amount: i64,
7056 pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
7060 pub currency: stripe_types::Currency,
7064 #[serde(skip_serializing_if = "Option::is_none")]
7066 pub description: Option<String>,
7067 #[serde(skip_serializing_if = "Option::is_none")]
7071 pub end_date: Option<stripe_types::Timestamp>,
7072 pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
7074 #[serde(skip_serializing_if = "Option::is_none")]
7079 pub interval_count: Option<u64>,
7080 pub reference: String,
7082 pub start_date: stripe_types::Timestamp,
7084 #[serde(skip_serializing_if = "Option::is_none")]
7086 pub supported_types:
7087 Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
7088}
7089impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
7090 pub fn new(
7091 amount: impl Into<i64>,
7092 amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
7093 currency: impl Into<stripe_types::Currency>,
7094 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
7095 reference: impl Into<String>,
7096 start_date: impl Into<stripe_types::Timestamp>,
7097 ) -> Self {
7098 Self {
7099 amount: amount.into(),
7100 amount_type: amount_type.into(),
7101 currency: currency.into(),
7102 description: None,
7103 end_date: None,
7104 interval: interval.into(),
7105 interval_count: None,
7106 reference: reference.into(),
7107 start_date: start_date.into(),
7108 supported_types: None,
7109 }
7110 }
7111}
7112#[derive(Clone, Eq, PartialEq)]
7116#[non_exhaustive]
7117pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7118 Fixed,
7119 Maximum,
7120 Unknown(String),
7122}
7123impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7124 pub fn as_str(&self) -> &str {
7125 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
7126 match self {
7127 Fixed => "fixed",
7128 Maximum => "maximum",
7129 Unknown(v) => v,
7130 }
7131 }
7132}
7133
7134impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7135 type Err = std::convert::Infallible;
7136 fn from_str(s: &str) -> Result<Self, Self::Err> {
7137 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
7138 match s {
7139 "fixed" => Ok(Fixed),
7140 "maximum" => Ok(Maximum),
7141 v => {
7142 tracing::warn!(
7143 "Unknown value '{}' for enum '{}'",
7144 v,
7145 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
7146 );
7147 Ok(Unknown(v.to_owned()))
7148 }
7149 }
7150 }
7151}
7152impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7153 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7154 f.write_str(self.as_str())
7155 }
7156}
7157
7158impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7159 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7160 f.write_str(self.as_str())
7161 }
7162}
7163impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7164 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7165 where
7166 S: serde::Serializer,
7167 {
7168 serializer.serialize_str(self.as_str())
7169 }
7170}
7171#[cfg(feature = "deserialize")]
7172impl<'de> serde::Deserialize<'de>
7173 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
7174{
7175 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7176 use std::str::FromStr;
7177 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7178 Ok(Self::from_str(&s).expect("infallible"))
7179 }
7180}
7181#[derive(Clone, Eq, PartialEq)]
7183#[non_exhaustive]
7184pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7185 Day,
7186 Month,
7187 Sporadic,
7188 Week,
7189 Year,
7190 Unknown(String),
7192}
7193impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7194 pub fn as_str(&self) -> &str {
7195 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
7196 match self {
7197 Day => "day",
7198 Month => "month",
7199 Sporadic => "sporadic",
7200 Week => "week",
7201 Year => "year",
7202 Unknown(v) => v,
7203 }
7204 }
7205}
7206
7207impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7208 type Err = std::convert::Infallible;
7209 fn from_str(s: &str) -> Result<Self, Self::Err> {
7210 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
7211 match s {
7212 "day" => Ok(Day),
7213 "month" => Ok(Month),
7214 "sporadic" => Ok(Sporadic),
7215 "week" => Ok(Week),
7216 "year" => Ok(Year),
7217 v => {
7218 tracing::warn!(
7219 "Unknown value '{}' for enum '{}'",
7220 v,
7221 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
7222 );
7223 Ok(Unknown(v.to_owned()))
7224 }
7225 }
7226 }
7227}
7228impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7229 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7230 f.write_str(self.as_str())
7231 }
7232}
7233
7234impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7235 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7236 f.write_str(self.as_str())
7237 }
7238}
7239impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7240 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7241 where
7242 S: serde::Serializer,
7243 {
7244 serializer.serialize_str(self.as_str())
7245 }
7246}
7247#[cfg(feature = "deserialize")]
7248impl<'de> serde::Deserialize<'de>
7249 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
7250{
7251 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7252 use std::str::FromStr;
7253 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7254 Ok(Self::from_str(&s).expect("infallible"))
7255 }
7256}
7257#[derive(Clone, Eq, PartialEq)]
7259#[non_exhaustive]
7260pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7261 India,
7262 Unknown(String),
7264}
7265impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7266 pub fn as_str(&self) -> &str {
7267 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
7268 match self {
7269 India => "india",
7270 Unknown(v) => v,
7271 }
7272 }
7273}
7274
7275impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7276 type Err = std::convert::Infallible;
7277 fn from_str(s: &str) -> Result<Self, Self::Err> {
7278 use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
7279 match s {
7280 "india" => Ok(India),
7281 v => {
7282 tracing::warn!(
7283 "Unknown value '{}' for enum '{}'",
7284 v,
7285 "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
7286 );
7287 Ok(Unknown(v.to_owned()))
7288 }
7289 }
7290 }
7291}
7292impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7293 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7294 f.write_str(self.as_str())
7295 }
7296}
7297
7298impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7299 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7300 f.write_str(self.as_str())
7301 }
7302}
7303impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7304 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7305 where
7306 S: serde::Serializer,
7307 {
7308 serializer.serialize_str(self.as_str())
7309 }
7310}
7311#[cfg(feature = "deserialize")]
7312impl<'de> serde::Deserialize<'de>
7313 for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
7314{
7315 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7316 use std::str::FromStr;
7317 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7318 Ok(Self::from_str(&s).expect("infallible"))
7319 }
7320}
7321#[derive(Clone, Eq, PartialEq)]
7325#[non_exhaustive]
7326pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7327 Amex,
7328 CartesBancaires,
7329 Diners,
7330 Discover,
7331 EftposAu,
7332 Girocard,
7333 Interac,
7334 Jcb,
7335 Link,
7336 Mastercard,
7337 Unionpay,
7338 Unknown,
7339 Visa,
7340 _Unknown(String),
7343}
7344impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7345 pub fn as_str(&self) -> &str {
7346 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
7347 match self {
7348 Amex => "amex",
7349 CartesBancaires => "cartes_bancaires",
7350 Diners => "diners",
7351 Discover => "discover",
7352 EftposAu => "eftpos_au",
7353 Girocard => "girocard",
7354 Interac => "interac",
7355 Jcb => "jcb",
7356 Link => "link",
7357 Mastercard => "mastercard",
7358 Unionpay => "unionpay",
7359 Unknown => "unknown",
7360 Visa => "visa",
7361 _Unknown(v) => v,
7362 }
7363 }
7364}
7365
7366impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7367 type Err = std::convert::Infallible;
7368 fn from_str(s: &str) -> Result<Self, Self::Err> {
7369 use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
7370 match s {
7371 "amex" => Ok(Amex),
7372 "cartes_bancaires" => Ok(CartesBancaires),
7373 "diners" => Ok(Diners),
7374 "discover" => Ok(Discover),
7375 "eftpos_au" => Ok(EftposAu),
7376 "girocard" => Ok(Girocard),
7377 "interac" => Ok(Interac),
7378 "jcb" => Ok(Jcb),
7379 "link" => Ok(Link),
7380 "mastercard" => Ok(Mastercard),
7381 "unionpay" => Ok(Unionpay),
7382 "unknown" => Ok(Unknown),
7383 "visa" => Ok(Visa),
7384 v => {
7385 tracing::warn!(
7386 "Unknown value '{}' for enum '{}'",
7387 v,
7388 "UpdateSetupIntentPaymentMethodOptionsCardNetwork"
7389 );
7390 Ok(_Unknown(v.to_owned()))
7391 }
7392 }
7393 }
7394}
7395impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7396 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7397 f.write_str(self.as_str())
7398 }
7399}
7400
7401impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7402 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7403 f.write_str(self.as_str())
7404 }
7405}
7406impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7407 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7408 where
7409 S: serde::Serializer,
7410 {
7411 serializer.serialize_str(self.as_str())
7412 }
7413}
7414#[cfg(feature = "deserialize")]
7415impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7416 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7417 use std::str::FromStr;
7418 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7419 Ok(Self::from_str(&s).expect("infallible"))
7420 }
7421}
7422#[derive(Clone, Eq, PartialEq)]
7427#[non_exhaustive]
7428pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7429 Any,
7430 Automatic,
7431 Challenge,
7432 Unknown(String),
7434}
7435impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7436 pub fn as_str(&self) -> &str {
7437 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
7438 match self {
7439 Any => "any",
7440 Automatic => "automatic",
7441 Challenge => "challenge",
7442 Unknown(v) => v,
7443 }
7444 }
7445}
7446
7447impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7448 type Err = std::convert::Infallible;
7449 fn from_str(s: &str) -> Result<Self, Self::Err> {
7450 use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
7451 match s {
7452 "any" => Ok(Any),
7453 "automatic" => Ok(Automatic),
7454 "challenge" => Ok(Challenge),
7455 v => {
7456 tracing::warn!(
7457 "Unknown value '{}' for enum '{}'",
7458 v,
7459 "UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
7460 );
7461 Ok(Unknown(v.to_owned()))
7462 }
7463 }
7464 }
7465}
7466impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7467 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7468 f.write_str(self.as_str())
7469 }
7470}
7471
7472impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7473 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7474 f.write_str(self.as_str())
7475 }
7476}
7477impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7478 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7479 where
7480 S: serde::Serializer,
7481 {
7482 serializer.serialize_str(self.as_str())
7483 }
7484}
7485#[cfg(feature = "deserialize")]
7486impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7487 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7488 use std::str::FromStr;
7489 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7490 Ok(Self::from_str(&s).expect("infallible"))
7491 }
7492}
7493#[derive(Clone, Debug, serde::Serialize)]
7496pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7497 #[serde(skip_serializing_if = "Option::is_none")]
7499 pub ares_trans_status:
7500 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
7501 #[serde(skip_serializing_if = "Option::is_none")]
7506 pub cryptogram: Option<String>,
7507 #[serde(skip_serializing_if = "Option::is_none")]
7510 pub electronic_commerce_indicator:
7511 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
7512 #[serde(skip_serializing_if = "Option::is_none")]
7516 pub network_options:
7517 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
7518 #[serde(skip_serializing_if = "Option::is_none")]
7521 pub requestor_challenge_indicator: Option<String>,
7522 #[serde(skip_serializing_if = "Option::is_none")]
7525 pub transaction_id: Option<String>,
7526 #[serde(skip_serializing_if = "Option::is_none")]
7528 pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
7529}
7530impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7531 pub fn new() -> Self {
7532 Self {
7533 ares_trans_status: None,
7534 cryptogram: None,
7535 electronic_commerce_indicator: None,
7536 network_options: None,
7537 requestor_challenge_indicator: None,
7538 transaction_id: None,
7539 version: None,
7540 }
7541 }
7542}
7543impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7544 fn default() -> Self {
7545 Self::new()
7546 }
7547}
7548#[derive(Clone, Eq, PartialEq)]
7550#[non_exhaustive]
7551pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7552 A,
7553 C,
7554 I,
7555 N,
7556 R,
7557 U,
7558 Y,
7559 Unknown(String),
7561}
7562impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7563 pub fn as_str(&self) -> &str {
7564 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7565 match self {
7566 A => "A",
7567 C => "C",
7568 I => "I",
7569 N => "N",
7570 R => "R",
7571 U => "U",
7572 Y => "Y",
7573 Unknown(v) => v,
7574 }
7575 }
7576}
7577
7578impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7579 type Err = std::convert::Infallible;
7580 fn from_str(s: &str) -> Result<Self, Self::Err> {
7581 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7582 match s {
7583 "A" => Ok(A),
7584 "C" => Ok(C),
7585 "I" => Ok(I),
7586 "N" => Ok(N),
7587 "R" => Ok(R),
7588 "U" => Ok(U),
7589 "Y" => Ok(Y),
7590 v => {
7591 tracing::warn!(
7592 "Unknown value '{}' for enum '{}'",
7593 v,
7594 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
7595 );
7596 Ok(Unknown(v.to_owned()))
7597 }
7598 }
7599 }
7600}
7601impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7602 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7603 f.write_str(self.as_str())
7604 }
7605}
7606
7607impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7608 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7609 f.write_str(self.as_str())
7610 }
7611}
7612impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7613 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7614 where
7615 S: serde::Serializer,
7616 {
7617 serializer.serialize_str(self.as_str())
7618 }
7619}
7620#[cfg(feature = "deserialize")]
7621impl<'de> serde::Deserialize<'de>
7622 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
7623{
7624 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7625 use std::str::FromStr;
7626 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7627 Ok(Self::from_str(&s).expect("infallible"))
7628 }
7629}
7630#[derive(Clone, Eq, PartialEq)]
7633#[non_exhaustive]
7634pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7635 V01,
7636 V02,
7637 V05,
7638 V06,
7639 V07,
7640 Unknown(String),
7642}
7643impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7644 pub fn as_str(&self) -> &str {
7645 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7646 match self {
7647 V01 => "01",
7648 V02 => "02",
7649 V05 => "05",
7650 V06 => "06",
7651 V07 => "07",
7652 Unknown(v) => v,
7653 }
7654 }
7655}
7656
7657impl std::str::FromStr
7658 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7659{
7660 type Err = std::convert::Infallible;
7661 fn from_str(s: &str) -> Result<Self, Self::Err> {
7662 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7663 match s {
7664 "01" => Ok(V01),
7665 "02" => Ok(V02),
7666 "05" => Ok(V05),
7667 "06" => Ok(V06),
7668 "07" => Ok(V07),
7669 v => {
7670 tracing::warn!(
7671 "Unknown value '{}' for enum '{}'",
7672 v,
7673 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
7674 );
7675 Ok(Unknown(v.to_owned()))
7676 }
7677 }
7678 }
7679}
7680impl std::fmt::Display
7681 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7682{
7683 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7684 f.write_str(self.as_str())
7685 }
7686}
7687
7688impl std::fmt::Debug
7689 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7690{
7691 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7692 f.write_str(self.as_str())
7693 }
7694}
7695impl serde::Serialize
7696 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7697{
7698 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7699 where
7700 S: serde::Serializer,
7701 {
7702 serializer.serialize_str(self.as_str())
7703 }
7704}
7705#[cfg(feature = "deserialize")]
7706impl<'de> serde::Deserialize<'de>
7707 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7708{
7709 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7710 use std::str::FromStr;
7711 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7712 Ok(Self::from_str(&s).expect("infallible"))
7713 }
7714}
7715#[derive(Clone, Debug, serde::Serialize)]
7719pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7720 #[serde(skip_serializing_if = "Option::is_none")]
7722 pub cartes_bancaires:
7723 Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
7724}
7725impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7726 pub fn new() -> Self {
7727 Self { cartes_bancaires: None }
7728 }
7729}
7730impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7731 fn default() -> Self {
7732 Self::new()
7733 }
7734}
7735#[derive(Clone, Debug, serde::Serialize)]
7737pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7738 pub cb_avalgo:
7742 UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
7743 #[serde(skip_serializing_if = "Option::is_none")]
7748 pub cb_exemption: Option<String>,
7749 #[serde(skip_serializing_if = "Option::is_none")]
7752 pub cb_score: Option<i64>,
7753}
7754impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7755 pub fn new(
7756 cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
7757 ) -> Self {
7758 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
7759 }
7760}
7761#[derive(Clone, Eq, PartialEq)]
7765#[non_exhaustive]
7766pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7767{
7768 V0,
7769 V1,
7770 V2,
7771 V3,
7772 V4,
7773 A,
7774 Unknown(String),
7776}
7777impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
7778 pub fn as_str(&self) -> &str {
7779 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7780 match self {
7781 V0 => "0",
7782 V1 => "1",
7783 V2 => "2",
7784 V3 => "3",
7785 V4 => "4",
7786 A => "A",
7787 Unknown(v) => v,
7788 }
7789 }
7790}
7791
7792impl std::str::FromStr
7793 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7794{
7795 type Err = std::convert::Infallible;
7796 fn from_str(s: &str) -> Result<Self, Self::Err> {
7797 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7798 match s {
7799 "0" => Ok(V0),
7800 "1" => Ok(V1),
7801 "2" => Ok(V2),
7802 "3" => Ok(V3),
7803 "4" => Ok(V4),
7804 "A" => Ok(A),
7805 v => {
7806 tracing::warn!(
7807 "Unknown value '{}' for enum '{}'",
7808 v,
7809 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
7810 );
7811 Ok(Unknown(v.to_owned()))
7812 }
7813 }
7814 }
7815}
7816impl std::fmt::Display
7817 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7818{
7819 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7820 f.write_str(self.as_str())
7821 }
7822}
7823
7824impl std::fmt::Debug
7825 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7826{
7827 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7828 f.write_str(self.as_str())
7829 }
7830}
7831impl serde::Serialize
7832 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7833{
7834 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7835 where
7836 S: serde::Serializer,
7837 {
7838 serializer.serialize_str(self.as_str())
7839 }
7840}
7841#[cfg(feature = "deserialize")]
7842impl<'de> serde::Deserialize<'de>
7843 for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7844{
7845 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7846 use std::str::FromStr;
7847 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7848 Ok(Self::from_str(&s).expect("infallible"))
7849 }
7850}
7851#[derive(Clone, Eq, PartialEq)]
7853#[non_exhaustive]
7854pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7855 V1_0_2,
7856 V2_1_0,
7857 V2_2_0,
7858 Unknown(String),
7860}
7861impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7862 pub fn as_str(&self) -> &str {
7863 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7864 match self {
7865 V1_0_2 => "1.0.2",
7866 V2_1_0 => "2.1.0",
7867 V2_2_0 => "2.2.0",
7868 Unknown(v) => v,
7869 }
7870 }
7871}
7872
7873impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7874 type Err = std::convert::Infallible;
7875 fn from_str(s: &str) -> Result<Self, Self::Err> {
7876 use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7877 match s {
7878 "1.0.2" => Ok(V1_0_2),
7879 "2.1.0" => Ok(V2_1_0),
7880 "2.2.0" => Ok(V2_2_0),
7881 v => {
7882 tracing::warn!(
7883 "Unknown value '{}' for enum '{}'",
7884 v,
7885 "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
7886 );
7887 Ok(Unknown(v.to_owned()))
7888 }
7889 }
7890 }
7891}
7892impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7893 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7894 f.write_str(self.as_str())
7895 }
7896}
7897
7898impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7899 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7900 f.write_str(self.as_str())
7901 }
7902}
7903impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7904 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7905 where
7906 S: serde::Serializer,
7907 {
7908 serializer.serialize_str(self.as_str())
7909 }
7910}
7911#[cfg(feature = "deserialize")]
7912impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7913 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7914 use std::str::FromStr;
7915 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7916 Ok(Self::from_str(&s).expect("infallible"))
7917 }
7918}
7919#[derive(Clone, Debug, serde::Serialize)]
7921pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
7922 #[serde(skip_serializing_if = "Option::is_none")]
7924 pub currency: Option<stripe_types::Currency>,
7925 #[serde(skip_serializing_if = "Option::is_none")]
7927 pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
7928 #[serde(skip_serializing_if = "Option::is_none")]
7930 pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7931 #[serde(skip_serializing_if = "Option::is_none")]
7933 pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7934}
7935impl UpdateSetupIntentPaymentMethodOptionsKlarna {
7936 pub fn new() -> Self {
7937 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
7938 }
7939}
7940impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
7941 fn default() -> Self {
7942 Self::new()
7943 }
7944}
7945#[derive(Clone, Debug, serde::Serialize)]
7947pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7948 #[serde(skip_serializing_if = "Option::is_none")]
7951 pub average_amount: Option<i64>,
7952 #[serde(skip_serializing_if = "Option::is_none")]
7955 pub maximum_amount: Option<i64>,
7956 #[serde(skip_serializing_if = "Option::is_none")]
7959 pub minimum_amount: Option<i64>,
7960 #[serde(skip_serializing_if = "Option::is_none")]
7962 pub purchase_interval:
7963 Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7964 #[serde(skip_serializing_if = "Option::is_none")]
7966 pub purchase_interval_count: Option<u64>,
7967}
7968impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7969 pub fn new() -> Self {
7970 Self {
7971 average_amount: None,
7972 maximum_amount: None,
7973 minimum_amount: None,
7974 purchase_interval: None,
7975 purchase_interval_count: None,
7976 }
7977 }
7978}
7979impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7980 fn default() -> Self {
7981 Self::new()
7982 }
7983}
7984#[derive(Clone, Eq, PartialEq)]
7986#[non_exhaustive]
7987pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7988 Day,
7989 Month,
7990 Week,
7991 Year,
7992 Unknown(String),
7994}
7995impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7996 pub fn as_str(&self) -> &str {
7997 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7998 match self {
7999 Day => "day",
8000 Month => "month",
8001 Week => "week",
8002 Year => "year",
8003 Unknown(v) => v,
8004 }
8005 }
8006}
8007
8008impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8009 type Err = std::convert::Infallible;
8010 fn from_str(s: &str) -> Result<Self, Self::Err> {
8011 use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
8012 match s {
8013 "day" => Ok(Day),
8014 "month" => Ok(Month),
8015 "week" => Ok(Week),
8016 "year" => Ok(Year),
8017 v => {
8018 tracing::warn!(
8019 "Unknown value '{}' for enum '{}'",
8020 v,
8021 "UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
8022 );
8023 Ok(Unknown(v.to_owned()))
8024 }
8025 }
8026 }
8027}
8028impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8029 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8030 f.write_str(self.as_str())
8031 }
8032}
8033
8034impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8035 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8036 f.write_str(self.as_str())
8037 }
8038}
8039impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8040 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8041 where
8042 S: serde::Serializer,
8043 {
8044 serializer.serialize_str(self.as_str())
8045 }
8046}
8047#[cfg(feature = "deserialize")]
8048impl<'de> serde::Deserialize<'de>
8049 for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
8050{
8051 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8052 use std::str::FromStr;
8053 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8054 Ok(Self::from_str(&s).expect("infallible"))
8055 }
8056}
8057#[derive(Clone, Eq, PartialEq)]
8059#[non_exhaustive]
8060pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8061 CsMinusCz,
8062 DaMinusDk,
8063 DeMinusAt,
8064 DeMinusCh,
8065 DeMinusDe,
8066 ElMinusGr,
8067 EnMinusAt,
8068 EnMinusAu,
8069 EnMinusBe,
8070 EnMinusCa,
8071 EnMinusCh,
8072 EnMinusCz,
8073 EnMinusDe,
8074 EnMinusDk,
8075 EnMinusEs,
8076 EnMinusFi,
8077 EnMinusFr,
8078 EnMinusGb,
8079 EnMinusGr,
8080 EnMinusIe,
8081 EnMinusIt,
8082 EnMinusNl,
8083 EnMinusNo,
8084 EnMinusNz,
8085 EnMinusPl,
8086 EnMinusPt,
8087 EnMinusRo,
8088 EnMinusSe,
8089 EnMinusUs,
8090 EsMinusEs,
8091 EsMinusUs,
8092 FiMinusFi,
8093 FrMinusBe,
8094 FrMinusCa,
8095 FrMinusCh,
8096 FrMinusFr,
8097 ItMinusCh,
8098 ItMinusIt,
8099 NbMinusNo,
8100 NlMinusBe,
8101 NlMinusNl,
8102 PlMinusPl,
8103 PtMinusPt,
8104 RoMinusRo,
8105 SvMinusFi,
8106 SvMinusSe,
8107 Unknown(String),
8109}
8110impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8111 pub fn as_str(&self) -> &str {
8112 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8113 match self {
8114 CsMinusCz => "cs-CZ",
8115 DaMinusDk => "da-DK",
8116 DeMinusAt => "de-AT",
8117 DeMinusCh => "de-CH",
8118 DeMinusDe => "de-DE",
8119 ElMinusGr => "el-GR",
8120 EnMinusAt => "en-AT",
8121 EnMinusAu => "en-AU",
8122 EnMinusBe => "en-BE",
8123 EnMinusCa => "en-CA",
8124 EnMinusCh => "en-CH",
8125 EnMinusCz => "en-CZ",
8126 EnMinusDe => "en-DE",
8127 EnMinusDk => "en-DK",
8128 EnMinusEs => "en-ES",
8129 EnMinusFi => "en-FI",
8130 EnMinusFr => "en-FR",
8131 EnMinusGb => "en-GB",
8132 EnMinusGr => "en-GR",
8133 EnMinusIe => "en-IE",
8134 EnMinusIt => "en-IT",
8135 EnMinusNl => "en-NL",
8136 EnMinusNo => "en-NO",
8137 EnMinusNz => "en-NZ",
8138 EnMinusPl => "en-PL",
8139 EnMinusPt => "en-PT",
8140 EnMinusRo => "en-RO",
8141 EnMinusSe => "en-SE",
8142 EnMinusUs => "en-US",
8143 EsMinusEs => "es-ES",
8144 EsMinusUs => "es-US",
8145 FiMinusFi => "fi-FI",
8146 FrMinusBe => "fr-BE",
8147 FrMinusCa => "fr-CA",
8148 FrMinusCh => "fr-CH",
8149 FrMinusFr => "fr-FR",
8150 ItMinusCh => "it-CH",
8151 ItMinusIt => "it-IT",
8152 NbMinusNo => "nb-NO",
8153 NlMinusBe => "nl-BE",
8154 NlMinusNl => "nl-NL",
8155 PlMinusPl => "pl-PL",
8156 PtMinusPt => "pt-PT",
8157 RoMinusRo => "ro-RO",
8158 SvMinusFi => "sv-FI",
8159 SvMinusSe => "sv-SE",
8160 Unknown(v) => v,
8161 }
8162 }
8163}
8164
8165impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8166 type Err = std::convert::Infallible;
8167 fn from_str(s: &str) -> Result<Self, Self::Err> {
8168 use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8169 match s {
8170 "cs-CZ" => Ok(CsMinusCz),
8171 "da-DK" => Ok(DaMinusDk),
8172 "de-AT" => Ok(DeMinusAt),
8173 "de-CH" => Ok(DeMinusCh),
8174 "de-DE" => Ok(DeMinusDe),
8175 "el-GR" => Ok(ElMinusGr),
8176 "en-AT" => Ok(EnMinusAt),
8177 "en-AU" => Ok(EnMinusAu),
8178 "en-BE" => Ok(EnMinusBe),
8179 "en-CA" => Ok(EnMinusCa),
8180 "en-CH" => Ok(EnMinusCh),
8181 "en-CZ" => Ok(EnMinusCz),
8182 "en-DE" => Ok(EnMinusDe),
8183 "en-DK" => Ok(EnMinusDk),
8184 "en-ES" => Ok(EnMinusEs),
8185 "en-FI" => Ok(EnMinusFi),
8186 "en-FR" => Ok(EnMinusFr),
8187 "en-GB" => Ok(EnMinusGb),
8188 "en-GR" => Ok(EnMinusGr),
8189 "en-IE" => Ok(EnMinusIe),
8190 "en-IT" => Ok(EnMinusIt),
8191 "en-NL" => Ok(EnMinusNl),
8192 "en-NO" => Ok(EnMinusNo),
8193 "en-NZ" => Ok(EnMinusNz),
8194 "en-PL" => Ok(EnMinusPl),
8195 "en-PT" => Ok(EnMinusPt),
8196 "en-RO" => Ok(EnMinusRo),
8197 "en-SE" => Ok(EnMinusSe),
8198 "en-US" => Ok(EnMinusUs),
8199 "es-ES" => Ok(EsMinusEs),
8200 "es-US" => Ok(EsMinusUs),
8201 "fi-FI" => Ok(FiMinusFi),
8202 "fr-BE" => Ok(FrMinusBe),
8203 "fr-CA" => Ok(FrMinusCa),
8204 "fr-CH" => Ok(FrMinusCh),
8205 "fr-FR" => Ok(FrMinusFr),
8206 "it-CH" => Ok(ItMinusCh),
8207 "it-IT" => Ok(ItMinusIt),
8208 "nb-NO" => Ok(NbMinusNo),
8209 "nl-BE" => Ok(NlMinusBe),
8210 "nl-NL" => Ok(NlMinusNl),
8211 "pl-PL" => Ok(PlMinusPl),
8212 "pt-PT" => Ok(PtMinusPt),
8213 "ro-RO" => Ok(RoMinusRo),
8214 "sv-FI" => Ok(SvMinusFi),
8215 "sv-SE" => Ok(SvMinusSe),
8216 v => {
8217 tracing::warn!(
8218 "Unknown value '{}' for enum '{}'",
8219 v,
8220 "UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
8221 );
8222 Ok(Unknown(v.to_owned()))
8223 }
8224 }
8225 }
8226}
8227impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8228 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8229 f.write_str(self.as_str())
8230 }
8231}
8232
8233impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8234 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8235 f.write_str(self.as_str())
8236 }
8237}
8238impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8239 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8240 where
8241 S: serde::Serializer,
8242 {
8243 serializer.serialize_str(self.as_str())
8244 }
8245}
8246#[cfg(feature = "deserialize")]
8247impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8248 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8249 use std::str::FromStr;
8250 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8251 Ok(Self::from_str(&s).expect("infallible"))
8252 }
8253}
8254#[derive(Clone, Debug, serde::Serialize)]
8256pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
8257 pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
8259 #[serde(skip_serializing_if = "Option::is_none")]
8262 pub interval_count: Option<u64>,
8263 #[serde(skip_serializing_if = "Option::is_none")]
8265 pub name: Option<String>,
8266 pub next_billing: SubscriptionNextBillingParam,
8268 pub reference: String,
8271}
8272impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
8273 pub fn new(
8274 interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
8275 next_billing: impl Into<SubscriptionNextBillingParam>,
8276 reference: impl Into<String>,
8277 ) -> Self {
8278 Self {
8279 interval: interval.into(),
8280 interval_count: None,
8281 name: None,
8282 next_billing: next_billing.into(),
8283 reference: reference.into(),
8284 }
8285 }
8286}
8287#[derive(Clone, Eq, PartialEq)]
8289#[non_exhaustive]
8290pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8291 Day,
8292 Month,
8293 Week,
8294 Year,
8295 Unknown(String),
8297}
8298impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8299 pub fn as_str(&self) -> &str {
8300 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8301 match self {
8302 Day => "day",
8303 Month => "month",
8304 Week => "week",
8305 Year => "year",
8306 Unknown(v) => v,
8307 }
8308 }
8309}
8310
8311impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8312 type Err = std::convert::Infallible;
8313 fn from_str(s: &str) -> Result<Self, Self::Err> {
8314 use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8315 match s {
8316 "day" => Ok(Day),
8317 "month" => Ok(Month),
8318 "week" => Ok(Week),
8319 "year" => Ok(Year),
8320 v => {
8321 tracing::warn!(
8322 "Unknown value '{}' for enum '{}'",
8323 v,
8324 "UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
8325 );
8326 Ok(Unknown(v.to_owned()))
8327 }
8328 }
8329 }
8330}
8331impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8332 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8333 f.write_str(self.as_str())
8334 }
8335}
8336
8337impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8338 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8339 f.write_str(self.as_str())
8340 }
8341}
8342impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8343 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8344 where
8345 S: serde::Serializer,
8346 {
8347 serializer.serialize_str(self.as_str())
8348 }
8349}
8350#[cfg(feature = "deserialize")]
8351impl<'de> serde::Deserialize<'de>
8352 for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
8353{
8354 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8355 use std::str::FromStr;
8356 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8357 Ok(Self::from_str(&s).expect("infallible"))
8358 }
8359}
8360#[derive(Clone, Debug, serde::Serialize)]
8362pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
8363 #[serde(skip_serializing_if = "Option::is_none")]
8365 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
8366}
8367impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
8368 pub fn new() -> Self {
8369 Self { mandate_options: None }
8370 }
8371}
8372impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
8373 fn default() -> Self {
8374 Self::new()
8375 }
8376}
8377#[derive(Clone, Debug, serde::Serialize)]
8379pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
8380 #[serde(skip_serializing_if = "Option::is_none")]
8385 pub reference_prefix: Option<String>,
8386}
8387impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
8388 pub fn new() -> Self {
8389 Self { reference_prefix: None }
8390 }
8391}
8392impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
8393 fn default() -> Self {
8394 Self::new()
8395 }
8396}
8397#[derive(Clone, Debug, serde::Serialize)]
8399pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
8400 #[serde(skip_serializing_if = "Option::is_none")]
8402 pub financial_connections:
8403 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
8404 #[serde(skip_serializing_if = "Option::is_none")]
8406 pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
8407 #[serde(skip_serializing_if = "Option::is_none")]
8409 pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
8410 #[serde(skip_serializing_if = "Option::is_none")]
8412 pub verification_method:
8413 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
8414}
8415impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
8416 pub fn new() -> Self {
8417 Self {
8418 financial_connections: None,
8419 mandate_options: None,
8420 networks: None,
8421 verification_method: None,
8422 }
8423 }
8424}
8425impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
8426 fn default() -> Self {
8427 Self::new()
8428 }
8429}
8430#[derive(Clone, Debug, serde::Serialize)]
8432pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
8433 #[serde(skip_serializing_if = "Option::is_none")]
8435 pub filters:
8436 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
8437 #[serde(skip_serializing_if = "Option::is_none")]
8441 pub permissions: Option<
8442 Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
8443 >,
8444 #[serde(skip_serializing_if = "Option::is_none")]
8446 pub prefetch:
8447 Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
8448 #[serde(skip_serializing_if = "Option::is_none")]
8451 pub return_url: Option<String>,
8452}
8453impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
8454 pub fn new() -> Self {
8455 Self { filters: None, permissions: None, prefetch: None, return_url: None }
8456 }
8457}
8458impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
8459 fn default() -> Self {
8460 Self::new()
8461 }
8462}
8463#[derive(Clone, Debug, serde::Serialize)]
8465pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
8466 #[serde(skip_serializing_if = "Option::is_none")]
8469pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
8470
8471}
8472impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
8473 pub fn new() -> Self {
8474 Self { account_subcategories: None }
8475 }
8476}
8477impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
8478 fn default() -> Self {
8479 Self::new()
8480 }
8481}
8482#[derive(Clone, Eq, PartialEq)]
8485#[non_exhaustive]
8486pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
8487{
8488 Checking,
8489 Savings,
8490 Unknown(String),
8492}
8493impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8494 pub fn as_str(&self) -> &str {
8495 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
8496 match self {
8497Checking => "checking",
8498Savings => "savings",
8499Unknown(v) => v,
8500
8501 }
8502 }
8503}
8504
8505impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8506 type Err = std::convert::Infallible;
8507 fn from_str(s: &str) -> Result<Self, Self::Err> {
8508 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
8509 match s {
8510 "checking" => Ok(Checking),
8511"savings" => Ok(Savings),
8512v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
8513
8514 }
8515 }
8516}
8517impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8518 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8519 f.write_str(self.as_str())
8520 }
8521}
8522
8523impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8524 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8525 f.write_str(self.as_str())
8526 }
8527}
8528impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8529 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
8530 serializer.serialize_str(self.as_str())
8531 }
8532}
8533#[cfg(feature = "deserialize")]
8534impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
8535 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8536 use std::str::FromStr;
8537 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8538 Ok(Self::from_str(&s).expect("infallible"))
8539 }
8540}
8541#[derive(Clone, Eq, PartialEq)]
8545#[non_exhaustive]
8546pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
8547 Balances,
8548 Ownership,
8549 PaymentMethod,
8550 Transactions,
8551 Unknown(String),
8553}
8554impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
8555 pub fn as_str(&self) -> &str {
8556 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
8557 match self {
8558 Balances => "balances",
8559 Ownership => "ownership",
8560 PaymentMethod => "payment_method",
8561 Transactions => "transactions",
8562 Unknown(v) => v,
8563 }
8564 }
8565}
8566
8567impl std::str::FromStr
8568 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8569{
8570 type Err = std::convert::Infallible;
8571 fn from_str(s: &str) -> Result<Self, Self::Err> {
8572 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
8573 match s {
8574 "balances" => Ok(Balances),
8575 "ownership" => Ok(Ownership),
8576 "payment_method" => Ok(PaymentMethod),
8577 "transactions" => Ok(Transactions),
8578 v => {
8579 tracing::warn!(
8580 "Unknown value '{}' for enum '{}'",
8581 v,
8582 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
8583 );
8584 Ok(Unknown(v.to_owned()))
8585 }
8586 }
8587 }
8588}
8589impl std::fmt::Display
8590 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8591{
8592 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8593 f.write_str(self.as_str())
8594 }
8595}
8596
8597impl std::fmt::Debug
8598 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8599{
8600 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8601 f.write_str(self.as_str())
8602 }
8603}
8604impl serde::Serialize
8605 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8606{
8607 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8608 where
8609 S: serde::Serializer,
8610 {
8611 serializer.serialize_str(self.as_str())
8612 }
8613}
8614#[cfg(feature = "deserialize")]
8615impl<'de> serde::Deserialize<'de>
8616 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8617{
8618 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8619 use std::str::FromStr;
8620 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8621 Ok(Self::from_str(&s).expect("infallible"))
8622 }
8623}
8624#[derive(Clone, Eq, PartialEq)]
8626#[non_exhaustive]
8627pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8628 Balances,
8629 Ownership,
8630 Transactions,
8631 Unknown(String),
8633}
8634impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8635 pub fn as_str(&self) -> &str {
8636 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8637 match self {
8638 Balances => "balances",
8639 Ownership => "ownership",
8640 Transactions => "transactions",
8641 Unknown(v) => v,
8642 }
8643 }
8644}
8645
8646impl std::str::FromStr
8647 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8648{
8649 type Err = std::convert::Infallible;
8650 fn from_str(s: &str) -> Result<Self, Self::Err> {
8651 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8652 match s {
8653 "balances" => Ok(Balances),
8654 "ownership" => Ok(Ownership),
8655 "transactions" => Ok(Transactions),
8656 v => {
8657 tracing::warn!(
8658 "Unknown value '{}' for enum '{}'",
8659 v,
8660 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
8661 );
8662 Ok(Unknown(v.to_owned()))
8663 }
8664 }
8665 }
8666}
8667impl std::fmt::Display
8668 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8669{
8670 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8671 f.write_str(self.as_str())
8672 }
8673}
8674
8675impl std::fmt::Debug
8676 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8677{
8678 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8679 f.write_str(self.as_str())
8680 }
8681}
8682impl serde::Serialize
8683 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8684{
8685 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8686 where
8687 S: serde::Serializer,
8688 {
8689 serializer.serialize_str(self.as_str())
8690 }
8691}
8692#[cfg(feature = "deserialize")]
8693impl<'de> serde::Deserialize<'de>
8694 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8695{
8696 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8697 use std::str::FromStr;
8698 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8699 Ok(Self::from_str(&s).expect("infallible"))
8700 }
8701}
8702#[derive(Clone, Debug, serde::Serialize)]
8704pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8705 #[serde(skip_serializing_if = "Option::is_none")]
8707 pub collection_method:
8708 Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
8709}
8710impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8711 pub fn new() -> Self {
8712 Self { collection_method: None }
8713 }
8714}
8715impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8716 fn default() -> Self {
8717 Self::new()
8718 }
8719}
8720#[derive(Clone, Eq, PartialEq)]
8722#[non_exhaustive]
8723pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8724 Paper,
8725 Unknown(String),
8727}
8728impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8729 pub fn as_str(&self) -> &str {
8730 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8731 match self {
8732 Paper => "paper",
8733 Unknown(v) => v,
8734 }
8735 }
8736}
8737
8738impl std::str::FromStr
8739 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8740{
8741 type Err = std::convert::Infallible;
8742 fn from_str(s: &str) -> Result<Self, Self::Err> {
8743 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8744 match s {
8745 "paper" => Ok(Paper),
8746 v => {
8747 tracing::warn!(
8748 "Unknown value '{}' for enum '{}'",
8749 v,
8750 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
8751 );
8752 Ok(Unknown(v.to_owned()))
8753 }
8754 }
8755 }
8756}
8757impl std::fmt::Display
8758 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8759{
8760 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8761 f.write_str(self.as_str())
8762 }
8763}
8764
8765impl std::fmt::Debug
8766 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8767{
8768 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8769 f.write_str(self.as_str())
8770 }
8771}
8772impl serde::Serialize
8773 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8774{
8775 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8776 where
8777 S: serde::Serializer,
8778 {
8779 serializer.serialize_str(self.as_str())
8780 }
8781}
8782#[cfg(feature = "deserialize")]
8783impl<'de> serde::Deserialize<'de>
8784 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8785{
8786 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8787 use std::str::FromStr;
8788 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8789 Ok(Self::from_str(&s).expect("infallible"))
8790 }
8791}
8792#[derive(Clone, Debug, serde::Serialize)]
8794pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8795 #[serde(skip_serializing_if = "Option::is_none")]
8797 pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
8798}
8799impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8800 pub fn new() -> Self {
8801 Self { requested: None }
8802 }
8803}
8804impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8805 fn default() -> Self {
8806 Self::new()
8807 }
8808}
8809#[derive(Clone, Eq, PartialEq)]
8811#[non_exhaustive]
8812pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8813 Ach,
8814 UsDomesticWire,
8815 Unknown(String),
8817}
8818impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8819 pub fn as_str(&self) -> &str {
8820 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8821 match self {
8822 Ach => "ach",
8823 UsDomesticWire => "us_domestic_wire",
8824 Unknown(v) => v,
8825 }
8826 }
8827}
8828
8829impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8830 type Err = std::convert::Infallible;
8831 fn from_str(s: &str) -> Result<Self, Self::Err> {
8832 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8833 match s {
8834 "ach" => Ok(Ach),
8835 "us_domestic_wire" => Ok(UsDomesticWire),
8836 v => {
8837 tracing::warn!(
8838 "Unknown value '{}' for enum '{}'",
8839 v,
8840 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
8841 );
8842 Ok(Unknown(v.to_owned()))
8843 }
8844 }
8845 }
8846}
8847impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8848 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8849 f.write_str(self.as_str())
8850 }
8851}
8852
8853impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8854 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8855 f.write_str(self.as_str())
8856 }
8857}
8858impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8859 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8860 where
8861 S: serde::Serializer,
8862 {
8863 serializer.serialize_str(self.as_str())
8864 }
8865}
8866#[cfg(feature = "deserialize")]
8867impl<'de> serde::Deserialize<'de>
8868 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
8869{
8870 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8871 use std::str::FromStr;
8872 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8873 Ok(Self::from_str(&s).expect("infallible"))
8874 }
8875}
8876#[derive(Clone, Eq, PartialEq)]
8878#[non_exhaustive]
8879pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8880 Automatic,
8881 Instant,
8882 Microdeposits,
8883 Unknown(String),
8885}
8886impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8887 pub fn as_str(&self) -> &str {
8888 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8889 match self {
8890 Automatic => "automatic",
8891 Instant => "instant",
8892 Microdeposits => "microdeposits",
8893 Unknown(v) => v,
8894 }
8895 }
8896}
8897
8898impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8899 type Err = std::convert::Infallible;
8900 fn from_str(s: &str) -> Result<Self, Self::Err> {
8901 use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8902 match s {
8903 "automatic" => Ok(Automatic),
8904 "instant" => Ok(Instant),
8905 "microdeposits" => Ok(Microdeposits),
8906 v => {
8907 tracing::warn!(
8908 "Unknown value '{}' for enum '{}'",
8909 v,
8910 "UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
8911 );
8912 Ok(Unknown(v.to_owned()))
8913 }
8914 }
8915 }
8916}
8917impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8918 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8919 f.write_str(self.as_str())
8920 }
8921}
8922
8923impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8924 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8925 f.write_str(self.as_str())
8926 }
8927}
8928impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8929 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8930 where
8931 S: serde::Serializer,
8932 {
8933 serializer.serialize_str(self.as_str())
8934 }
8935}
8936#[cfg(feature = "deserialize")]
8937impl<'de> serde::Deserialize<'de>
8938 for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
8939{
8940 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8941 use std::str::FromStr;
8942 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8943 Ok(Self::from_str(&s).expect("infallible"))
8944 }
8945}
8946#[derive(Clone, Debug, serde::Serialize)]
8948pub struct UpdateSetupIntent {
8949 inner: UpdateSetupIntentBuilder,
8950 intent: stripe_shared::SetupIntentId,
8951}
8952impl UpdateSetupIntent {
8953 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8955 Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
8956 }
8957 pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
8962 self.inner.attach_to_self = Some(attach_to_self.into());
8963 self
8964 }
8965 pub fn customer(mut self, customer: impl Into<String>) -> Self {
8970 self.inner.customer = Some(customer.into());
8971 self
8972 }
8973 pub fn description(mut self, description: impl Into<String>) -> Self {
8975 self.inner.description = Some(description.into());
8976 self
8977 }
8978 pub fn excluded_payment_method_types(
8980 mut self,
8981 excluded_payment_method_types: impl Into<
8982 Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
8983 >,
8984 ) -> Self {
8985 self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
8986 self
8987 }
8988 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8990 self.inner.expand = Some(expand.into());
8991 self
8992 }
8993 pub fn flow_directions(
8999 mut self,
9000 flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
9001 ) -> Self {
9002 self.inner.flow_directions = Some(flow_directions.into());
9003 self
9004 }
9005 pub fn metadata(
9010 mut self,
9011 metadata: impl Into<std::collections::HashMap<String, String>>,
9012 ) -> Self {
9013 self.inner.metadata = Some(metadata.into());
9014 self
9015 }
9016 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
9019 self.inner.payment_method = Some(payment_method.into());
9020 self
9021 }
9022 pub fn payment_method_configuration(
9024 mut self,
9025 payment_method_configuration: impl Into<String>,
9026 ) -> Self {
9027 self.inner.payment_method_configuration = Some(payment_method_configuration.into());
9028 self
9029 }
9030 pub fn payment_method_data(
9033 mut self,
9034 payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
9035 ) -> Self {
9036 self.inner.payment_method_data = Some(payment_method_data.into());
9037 self
9038 }
9039 pub fn payment_method_options(
9041 mut self,
9042 payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
9043 ) -> Self {
9044 self.inner.payment_method_options = Some(payment_method_options.into());
9045 self
9046 }
9047 pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
9051 self.inner.payment_method_types = Some(payment_method_types.into());
9052 self
9053 }
9054}
9055impl UpdateSetupIntent {
9056 pub async fn send<C: StripeClient>(
9058 &self,
9059 client: &C,
9060 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9061 self.customize().send(client).await
9062 }
9063
9064 pub fn send_blocking<C: StripeBlockingClient>(
9066 &self,
9067 client: &C,
9068 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9069 self.customize().send_blocking(client)
9070 }
9071}
9072
9073impl StripeRequest for UpdateSetupIntent {
9074 type Output = stripe_shared::SetupIntent;
9075
9076 fn build(&self) -> RequestBuilder {
9077 let intent = &self.intent;
9078 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
9079 .form(&self.inner)
9080 }
9081}
9082#[derive(Clone, Debug, serde::Serialize)]
9083struct CancelSetupIntentBuilder {
9084 #[serde(skip_serializing_if = "Option::is_none")]
9085 cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
9086 #[serde(skip_serializing_if = "Option::is_none")]
9087 expand: Option<Vec<String>>,
9088}
9089impl CancelSetupIntentBuilder {
9090 fn new() -> Self {
9091 Self { cancellation_reason: None, expand: None }
9092 }
9093}
9094#[derive(Clone, Debug, serde::Serialize)]
9101pub struct CancelSetupIntent {
9102 inner: CancelSetupIntentBuilder,
9103 intent: stripe_shared::SetupIntentId,
9104}
9105impl CancelSetupIntent {
9106 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
9108 Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
9109 }
9110 pub fn cancellation_reason(
9113 mut self,
9114 cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
9115 ) -> Self {
9116 self.inner.cancellation_reason = Some(cancellation_reason.into());
9117 self
9118 }
9119 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
9121 self.inner.expand = Some(expand.into());
9122 self
9123 }
9124}
9125impl CancelSetupIntent {
9126 pub async fn send<C: StripeClient>(
9128 &self,
9129 client: &C,
9130 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9131 self.customize().send(client).await
9132 }
9133
9134 pub fn send_blocking<C: StripeBlockingClient>(
9136 &self,
9137 client: &C,
9138 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9139 self.customize().send_blocking(client)
9140 }
9141}
9142
9143impl StripeRequest for CancelSetupIntent {
9144 type Output = stripe_shared::SetupIntent;
9145
9146 fn build(&self) -> RequestBuilder {
9147 let intent = &self.intent;
9148 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
9149 .form(&self.inner)
9150 }
9151}
9152#[derive(Clone, Debug, serde::Serialize)]
9153struct ConfirmSetupIntentBuilder {
9154 #[serde(skip_serializing_if = "Option::is_none")]
9155 confirmation_token: Option<String>,
9156 #[serde(skip_serializing_if = "Option::is_none")]
9157 expand: Option<Vec<String>>,
9158 #[serde(skip_serializing_if = "Option::is_none")]
9159 mandate_data: Option<ConfirmSetupIntentMandateData>,
9160 #[serde(skip_serializing_if = "Option::is_none")]
9161 payment_method: Option<String>,
9162 #[serde(skip_serializing_if = "Option::is_none")]
9163 payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
9164 #[serde(skip_serializing_if = "Option::is_none")]
9165 payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
9166 #[serde(skip_serializing_if = "Option::is_none")]
9167 return_url: Option<String>,
9168 #[serde(skip_serializing_if = "Option::is_none")]
9169 use_stripe_sdk: Option<bool>,
9170}
9171impl ConfirmSetupIntentBuilder {
9172 fn new() -> Self {
9173 Self {
9174 confirmation_token: None,
9175 expand: None,
9176 mandate_data: None,
9177 payment_method: None,
9178 payment_method_data: None,
9179 payment_method_options: None,
9180 return_url: None,
9181 use_stripe_sdk: None,
9182 }
9183 }
9184}
9185#[derive(Clone, Debug, serde::Serialize)]
9186#[serde(rename_all = "snake_case")]
9187pub enum ConfirmSetupIntentMandateData {
9188 #[serde(untagged)]
9189 SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
9190 #[serde(untagged)]
9191 ClientKeyParam(ConfirmSetupIntentClientKeyParam),
9192}
9193#[derive(Clone, Debug, serde::Serialize)]
9194pub struct ConfirmSetupIntentSecretKeyParam {
9195 pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
9197}
9198impl ConfirmSetupIntentSecretKeyParam {
9199 pub fn new(
9200 customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
9201 ) -> Self {
9202 Self { customer_acceptance: customer_acceptance.into() }
9203 }
9204}
9205#[derive(Clone, Debug, serde::Serialize)]
9207pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
9208 #[serde(skip_serializing_if = "Option::is_none")]
9210 pub accepted_at: Option<stripe_types::Timestamp>,
9211 #[serde(skip_serializing_if = "Option::is_none")]
9213 #[serde(with = "stripe_types::with_serde_json_opt")]
9214 pub offline: Option<miniserde::json::Value>,
9215 #[serde(skip_serializing_if = "Option::is_none")]
9217 pub online: Option<OnlineParam>,
9218 #[serde(rename = "type")]
9221 pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
9222}
9223impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
9224 pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
9225 Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
9226 }
9227}
9228#[derive(Clone, Eq, PartialEq)]
9231#[non_exhaustive]
9232pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9233 Offline,
9234 Online,
9235 Unknown(String),
9237}
9238impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9239 pub fn as_str(&self) -> &str {
9240 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
9241 match self {
9242 Offline => "offline",
9243 Online => "online",
9244 Unknown(v) => v,
9245 }
9246 }
9247}
9248
9249impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9250 type Err = std::convert::Infallible;
9251 fn from_str(s: &str) -> Result<Self, Self::Err> {
9252 use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
9253 match s {
9254 "offline" => Ok(Offline),
9255 "online" => Ok(Online),
9256 v => {
9257 tracing::warn!(
9258 "Unknown value '{}' for enum '{}'",
9259 v,
9260 "ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType"
9261 );
9262 Ok(Unknown(v.to_owned()))
9263 }
9264 }
9265 }
9266}
9267impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9268 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9269 f.write_str(self.as_str())
9270 }
9271}
9272
9273impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9274 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9275 f.write_str(self.as_str())
9276 }
9277}
9278impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9279 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9280 where
9281 S: serde::Serializer,
9282 {
9283 serializer.serialize_str(self.as_str())
9284 }
9285}
9286#[cfg(feature = "deserialize")]
9287impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9288 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9289 use std::str::FromStr;
9290 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9291 Ok(Self::from_str(&s).expect("infallible"))
9292 }
9293}
9294#[derive(Clone, Debug, serde::Serialize)]
9295pub struct ConfirmSetupIntentClientKeyParam {
9296 pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
9298}
9299impl ConfirmSetupIntentClientKeyParam {
9300 pub fn new(
9301 customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
9302 ) -> Self {
9303 Self { customer_acceptance: customer_acceptance.into() }
9304 }
9305}
9306#[derive(Clone, Debug, serde::Serialize)]
9308pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
9309 pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
9311 #[serde(rename = "type")]
9313 pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
9314}
9315impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
9316 pub fn new(
9317 online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
9318 type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
9319 ) -> Self {
9320 Self { online: online.into(), type_: type_.into() }
9321 }
9322}
9323#[derive(Clone, Debug, serde::Serialize)]
9325pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
9326 #[serde(skip_serializing_if = "Option::is_none")]
9328 pub ip_address: Option<String>,
9329 #[serde(skip_serializing_if = "Option::is_none")]
9331 pub user_agent: Option<String>,
9332}
9333impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
9334 pub fn new() -> Self {
9335 Self { ip_address: None, user_agent: None }
9336 }
9337}
9338impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
9339 fn default() -> Self {
9340 Self::new()
9341 }
9342}
9343#[derive(Clone, Eq, PartialEq)]
9345#[non_exhaustive]
9346pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9347 Online,
9348 Unknown(String),
9350}
9351impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9352 pub fn as_str(&self) -> &str {
9353 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
9354 match self {
9355 Online => "online",
9356 Unknown(v) => v,
9357 }
9358 }
9359}
9360
9361impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9362 type Err = std::convert::Infallible;
9363 fn from_str(s: &str) -> Result<Self, Self::Err> {
9364 use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
9365 match s {
9366 "online" => Ok(Online),
9367 v => {
9368 tracing::warn!(
9369 "Unknown value '{}' for enum '{}'",
9370 v,
9371 "ConfirmSetupIntentClientKeyParamCustomerAcceptanceType"
9372 );
9373 Ok(Unknown(v.to_owned()))
9374 }
9375 }
9376 }
9377}
9378impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9379 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9380 f.write_str(self.as_str())
9381 }
9382}
9383
9384impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9385 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9386 f.write_str(self.as_str())
9387 }
9388}
9389impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9390 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9391 where
9392 S: serde::Serializer,
9393 {
9394 serializer.serialize_str(self.as_str())
9395 }
9396}
9397#[cfg(feature = "deserialize")]
9398impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
9399 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9400 use std::str::FromStr;
9401 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9402 Ok(Self::from_str(&s).expect("infallible"))
9403 }
9404}
9405#[derive(Clone, Debug, serde::Serialize)]
9408pub struct ConfirmSetupIntentPaymentMethodData {
9409 #[serde(skip_serializing_if = "Option::is_none")]
9411 pub acss_debit: Option<PaymentMethodParam>,
9412 #[serde(skip_serializing_if = "Option::is_none")]
9414 #[serde(with = "stripe_types::with_serde_json_opt")]
9415 pub affirm: Option<miniserde::json::Value>,
9416 #[serde(skip_serializing_if = "Option::is_none")]
9418 #[serde(with = "stripe_types::with_serde_json_opt")]
9419 pub afterpay_clearpay: Option<miniserde::json::Value>,
9420 #[serde(skip_serializing_if = "Option::is_none")]
9422 #[serde(with = "stripe_types::with_serde_json_opt")]
9423 pub alipay: Option<miniserde::json::Value>,
9424 #[serde(skip_serializing_if = "Option::is_none")]
9428 pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
9429 #[serde(skip_serializing_if = "Option::is_none")]
9431 #[serde(with = "stripe_types::with_serde_json_opt")]
9432 pub alma: Option<miniserde::json::Value>,
9433 #[serde(skip_serializing_if = "Option::is_none")]
9435 #[serde(with = "stripe_types::with_serde_json_opt")]
9436 pub amazon_pay: Option<miniserde::json::Value>,
9437 #[serde(skip_serializing_if = "Option::is_none")]
9439 pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
9440 #[serde(skip_serializing_if = "Option::is_none")]
9442 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
9443 #[serde(skip_serializing_if = "Option::is_none")]
9445 #[serde(with = "stripe_types::with_serde_json_opt")]
9446 pub bancontact: Option<miniserde::json::Value>,
9447 #[serde(skip_serializing_if = "Option::is_none")]
9449 #[serde(with = "stripe_types::with_serde_json_opt")]
9450 pub billie: Option<miniserde::json::Value>,
9451 #[serde(skip_serializing_if = "Option::is_none")]
9453 pub billing_details: Option<BillingDetailsInnerParams>,
9454 #[serde(skip_serializing_if = "Option::is_none")]
9456 #[serde(with = "stripe_types::with_serde_json_opt")]
9457 pub blik: Option<miniserde::json::Value>,
9458 #[serde(skip_serializing_if = "Option::is_none")]
9460 pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
9461 #[serde(skip_serializing_if = "Option::is_none")]
9463 #[serde(with = "stripe_types::with_serde_json_opt")]
9464 pub cashapp: Option<miniserde::json::Value>,
9465 #[serde(skip_serializing_if = "Option::is_none")]
9467 #[serde(with = "stripe_types::with_serde_json_opt")]
9468 pub crypto: Option<miniserde::json::Value>,
9469 #[serde(skip_serializing_if = "Option::is_none")]
9471 #[serde(with = "stripe_types::with_serde_json_opt")]
9472 pub customer_balance: Option<miniserde::json::Value>,
9473 #[serde(skip_serializing_if = "Option::is_none")]
9475 pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
9476 #[serde(skip_serializing_if = "Option::is_none")]
9478 pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
9479 #[serde(skip_serializing_if = "Option::is_none")]
9481 #[serde(with = "stripe_types::with_serde_json_opt")]
9482 pub giropay: Option<miniserde::json::Value>,
9483 #[serde(skip_serializing_if = "Option::is_none")]
9485 #[serde(with = "stripe_types::with_serde_json_opt")]
9486 pub grabpay: Option<miniserde::json::Value>,
9487 #[serde(skip_serializing_if = "Option::is_none")]
9489 pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
9490 #[serde(skip_serializing_if = "Option::is_none")]
9492 #[serde(with = "stripe_types::with_serde_json_opt")]
9493 pub interac_present: Option<miniserde::json::Value>,
9494 #[serde(skip_serializing_if = "Option::is_none")]
9496 #[serde(with = "stripe_types::with_serde_json_opt")]
9497 pub kakao_pay: Option<miniserde::json::Value>,
9498 #[serde(skip_serializing_if = "Option::is_none")]
9500 pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
9501 #[serde(skip_serializing_if = "Option::is_none")]
9503 #[serde(with = "stripe_types::with_serde_json_opt")]
9504 pub konbini: Option<miniserde::json::Value>,
9505 #[serde(skip_serializing_if = "Option::is_none")]
9507 #[serde(with = "stripe_types::with_serde_json_opt")]
9508 pub kr_card: Option<miniserde::json::Value>,
9509 #[serde(skip_serializing_if = "Option::is_none")]
9511 #[serde(with = "stripe_types::with_serde_json_opt")]
9512 pub link: Option<miniserde::json::Value>,
9513 #[serde(skip_serializing_if = "Option::is_none")]
9515 #[serde(with = "stripe_types::with_serde_json_opt")]
9516 pub mb_way: Option<miniserde::json::Value>,
9517 #[serde(skip_serializing_if = "Option::is_none")]
9522 pub metadata: Option<std::collections::HashMap<String, String>>,
9523 #[serde(skip_serializing_if = "Option::is_none")]
9525 #[serde(with = "stripe_types::with_serde_json_opt")]
9526 pub mobilepay: Option<miniserde::json::Value>,
9527 #[serde(skip_serializing_if = "Option::is_none")]
9529 #[serde(with = "stripe_types::with_serde_json_opt")]
9530 pub multibanco: Option<miniserde::json::Value>,
9531 #[serde(skip_serializing_if = "Option::is_none")]
9533 pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
9534 #[serde(skip_serializing_if = "Option::is_none")]
9536 pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
9537 #[serde(skip_serializing_if = "Option::is_none")]
9539 #[serde(with = "stripe_types::with_serde_json_opt")]
9540 pub oxxo: Option<miniserde::json::Value>,
9541 #[serde(skip_serializing_if = "Option::is_none")]
9543 pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
9544 #[serde(skip_serializing_if = "Option::is_none")]
9546 #[serde(with = "stripe_types::with_serde_json_opt")]
9547 pub pay_by_bank: Option<miniserde::json::Value>,
9548 #[serde(skip_serializing_if = "Option::is_none")]
9550 #[serde(with = "stripe_types::with_serde_json_opt")]
9551 pub payco: Option<miniserde::json::Value>,
9552 #[serde(skip_serializing_if = "Option::is_none")]
9554 #[serde(with = "stripe_types::with_serde_json_opt")]
9555 pub paynow: Option<miniserde::json::Value>,
9556 #[serde(skip_serializing_if = "Option::is_none")]
9558 #[serde(with = "stripe_types::with_serde_json_opt")]
9559 pub paypal: Option<miniserde::json::Value>,
9560 #[serde(skip_serializing_if = "Option::is_none")]
9562 #[serde(with = "stripe_types::with_serde_json_opt")]
9563 pub pix: Option<miniserde::json::Value>,
9564 #[serde(skip_serializing_if = "Option::is_none")]
9566 #[serde(with = "stripe_types::with_serde_json_opt")]
9567 pub promptpay: Option<miniserde::json::Value>,
9568 #[serde(skip_serializing_if = "Option::is_none")]
9571 pub radar_options: Option<RadarOptionsWithHiddenOptions>,
9572 #[serde(skip_serializing_if = "Option::is_none")]
9574 #[serde(with = "stripe_types::with_serde_json_opt")]
9575 pub revolut_pay: Option<miniserde::json::Value>,
9576 #[serde(skip_serializing_if = "Option::is_none")]
9578 #[serde(with = "stripe_types::with_serde_json_opt")]
9579 pub samsung_pay: Option<miniserde::json::Value>,
9580 #[serde(skip_serializing_if = "Option::is_none")]
9582 #[serde(with = "stripe_types::with_serde_json_opt")]
9583 pub satispay: Option<miniserde::json::Value>,
9584 #[serde(skip_serializing_if = "Option::is_none")]
9586 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
9587 #[serde(skip_serializing_if = "Option::is_none")]
9589 pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
9590 #[serde(skip_serializing_if = "Option::is_none")]
9592 #[serde(with = "stripe_types::with_serde_json_opt")]
9593 pub swish: Option<miniserde::json::Value>,
9594 #[serde(skip_serializing_if = "Option::is_none")]
9596 #[serde(with = "stripe_types::with_serde_json_opt")]
9597 pub twint: Option<miniserde::json::Value>,
9598 #[serde(rename = "type")]
9602 pub type_: ConfirmSetupIntentPaymentMethodDataType,
9603 #[serde(skip_serializing_if = "Option::is_none")]
9605 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
9606 #[serde(skip_serializing_if = "Option::is_none")]
9608 #[serde(with = "stripe_types::with_serde_json_opt")]
9609 pub wechat_pay: Option<miniserde::json::Value>,
9610 #[serde(skip_serializing_if = "Option::is_none")]
9612 #[serde(with = "stripe_types::with_serde_json_opt")]
9613 pub zip: Option<miniserde::json::Value>,
9614}
9615impl ConfirmSetupIntentPaymentMethodData {
9616 pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
9617 Self {
9618 acss_debit: None,
9619 affirm: None,
9620 afterpay_clearpay: None,
9621 alipay: None,
9622 allow_redisplay: None,
9623 alma: None,
9624 amazon_pay: None,
9625 au_becs_debit: None,
9626 bacs_debit: None,
9627 bancontact: None,
9628 billie: None,
9629 billing_details: None,
9630 blik: None,
9631 boleto: None,
9632 cashapp: None,
9633 crypto: None,
9634 customer_balance: None,
9635 eps: None,
9636 fpx: None,
9637 giropay: None,
9638 grabpay: None,
9639 ideal: None,
9640 interac_present: None,
9641 kakao_pay: None,
9642 klarna: None,
9643 konbini: None,
9644 kr_card: None,
9645 link: None,
9646 mb_way: None,
9647 metadata: None,
9648 mobilepay: None,
9649 multibanco: None,
9650 naver_pay: None,
9651 nz_bank_account: None,
9652 oxxo: None,
9653 p24: None,
9654 pay_by_bank: None,
9655 payco: None,
9656 paynow: None,
9657 paypal: None,
9658 pix: None,
9659 promptpay: None,
9660 radar_options: None,
9661 revolut_pay: None,
9662 samsung_pay: None,
9663 satispay: None,
9664 sepa_debit: None,
9665 sofort: None,
9666 swish: None,
9667 twint: None,
9668 type_: type_.into(),
9669 us_bank_account: None,
9670 wechat_pay: None,
9671 zip: None,
9672 }
9673 }
9674}
9675#[derive(Clone, Eq, PartialEq)]
9679#[non_exhaustive]
9680pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9681 Always,
9682 Limited,
9683 Unspecified,
9684 Unknown(String),
9686}
9687impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9688 pub fn as_str(&self) -> &str {
9689 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9690 match self {
9691 Always => "always",
9692 Limited => "limited",
9693 Unspecified => "unspecified",
9694 Unknown(v) => v,
9695 }
9696 }
9697}
9698
9699impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9700 type Err = std::convert::Infallible;
9701 fn from_str(s: &str) -> Result<Self, Self::Err> {
9702 use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9703 match s {
9704 "always" => Ok(Always),
9705 "limited" => Ok(Limited),
9706 "unspecified" => Ok(Unspecified),
9707 v => {
9708 tracing::warn!(
9709 "Unknown value '{}' for enum '{}'",
9710 v,
9711 "ConfirmSetupIntentPaymentMethodDataAllowRedisplay"
9712 );
9713 Ok(Unknown(v.to_owned()))
9714 }
9715 }
9716 }
9717}
9718impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9719 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9720 f.write_str(self.as_str())
9721 }
9722}
9723
9724impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9725 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9726 f.write_str(self.as_str())
9727 }
9728}
9729impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9730 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9731 where
9732 S: serde::Serializer,
9733 {
9734 serializer.serialize_str(self.as_str())
9735 }
9736}
9737#[cfg(feature = "deserialize")]
9738impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9739 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9740 use std::str::FromStr;
9741 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9742 Ok(Self::from_str(&s).expect("infallible"))
9743 }
9744}
9745#[derive(Clone, Debug, serde::Serialize)]
9747pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9748 pub account_number: String,
9750 pub bsb_number: String,
9752}
9753impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9754 pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
9755 Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
9756 }
9757}
9758#[derive(Clone, Debug, serde::Serialize)]
9760pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
9761 #[serde(skip_serializing_if = "Option::is_none")]
9763 pub account_number: Option<String>,
9764 #[serde(skip_serializing_if = "Option::is_none")]
9766 pub sort_code: Option<String>,
9767}
9768impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
9769 pub fn new() -> Self {
9770 Self { account_number: None, sort_code: None }
9771 }
9772}
9773impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
9774 fn default() -> Self {
9775 Self::new()
9776 }
9777}
9778#[derive(Clone, Debug, serde::Serialize)]
9780pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
9781 pub tax_id: String,
9783}
9784impl ConfirmSetupIntentPaymentMethodDataBoleto {
9785 pub fn new(tax_id: impl Into<String>) -> Self {
9786 Self { tax_id: tax_id.into() }
9787 }
9788}
9789#[derive(Clone, Debug, serde::Serialize)]
9791pub struct ConfirmSetupIntentPaymentMethodDataEps {
9792 #[serde(skip_serializing_if = "Option::is_none")]
9794 pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
9795}
9796impl ConfirmSetupIntentPaymentMethodDataEps {
9797 pub fn new() -> Self {
9798 Self { bank: None }
9799 }
9800}
9801impl Default for ConfirmSetupIntentPaymentMethodDataEps {
9802 fn default() -> Self {
9803 Self::new()
9804 }
9805}
9806#[derive(Clone, Eq, PartialEq)]
9808#[non_exhaustive]
9809pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
9810 ArzteUndApothekerBank,
9811 AustrianAnadiBankAg,
9812 BankAustria,
9813 BankhausCarlSpangler,
9814 BankhausSchelhammerUndSchatteraAg,
9815 BawagPskAg,
9816 BksBankAg,
9817 BrullKallmusBankAg,
9818 BtvVierLanderBank,
9819 CapitalBankGraweGruppeAg,
9820 DeutscheBankAg,
9821 Dolomitenbank,
9822 EasybankAg,
9823 ErsteBankUndSparkassen,
9824 HypoAlpeadriabankInternationalAg,
9825 HypoBankBurgenlandAktiengesellschaft,
9826 HypoNoeLbFurNiederosterreichUWien,
9827 HypoOberosterreichSalzburgSteiermark,
9828 HypoTirolBankAg,
9829 HypoVorarlbergBankAg,
9830 MarchfelderBank,
9831 OberbankAg,
9832 RaiffeisenBankengruppeOsterreich,
9833 SchoellerbankAg,
9834 SpardaBankWien,
9835 VolksbankGruppe,
9836 VolkskreditbankAg,
9837 VrBankBraunau,
9838 Unknown(String),
9840}
9841impl ConfirmSetupIntentPaymentMethodDataEpsBank {
9842 pub fn as_str(&self) -> &str {
9843 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9844 match self {
9845 ArzteUndApothekerBank => "arzte_und_apotheker_bank",
9846 AustrianAnadiBankAg => "austrian_anadi_bank_ag",
9847 BankAustria => "bank_austria",
9848 BankhausCarlSpangler => "bankhaus_carl_spangler",
9849 BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
9850 BawagPskAg => "bawag_psk_ag",
9851 BksBankAg => "bks_bank_ag",
9852 BrullKallmusBankAg => "brull_kallmus_bank_ag",
9853 BtvVierLanderBank => "btv_vier_lander_bank",
9854 CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
9855 DeutscheBankAg => "deutsche_bank_ag",
9856 Dolomitenbank => "dolomitenbank",
9857 EasybankAg => "easybank_ag",
9858 ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
9859 HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
9860 HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
9861 HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
9862 HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
9863 HypoTirolBankAg => "hypo_tirol_bank_ag",
9864 HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
9865 MarchfelderBank => "marchfelder_bank",
9866 OberbankAg => "oberbank_ag",
9867 RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
9868 SchoellerbankAg => "schoellerbank_ag",
9869 SpardaBankWien => "sparda_bank_wien",
9870 VolksbankGruppe => "volksbank_gruppe",
9871 VolkskreditbankAg => "volkskreditbank_ag",
9872 VrBankBraunau => "vr_bank_braunau",
9873 Unknown(v) => v,
9874 }
9875 }
9876}
9877
9878impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
9879 type Err = std::convert::Infallible;
9880 fn from_str(s: &str) -> Result<Self, Self::Err> {
9881 use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9882 match s {
9883 "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
9884 "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
9885 "bank_austria" => Ok(BankAustria),
9886 "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
9887 "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
9888 "bawag_psk_ag" => Ok(BawagPskAg),
9889 "bks_bank_ag" => Ok(BksBankAg),
9890 "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
9891 "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
9892 "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
9893 "deutsche_bank_ag" => Ok(DeutscheBankAg),
9894 "dolomitenbank" => Ok(Dolomitenbank),
9895 "easybank_ag" => Ok(EasybankAg),
9896 "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
9897 "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
9898 "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
9899 "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
9900 "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
9901 "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
9902 "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
9903 "marchfelder_bank" => Ok(MarchfelderBank),
9904 "oberbank_ag" => Ok(OberbankAg),
9905 "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
9906 "schoellerbank_ag" => Ok(SchoellerbankAg),
9907 "sparda_bank_wien" => Ok(SpardaBankWien),
9908 "volksbank_gruppe" => Ok(VolksbankGruppe),
9909 "volkskreditbank_ag" => Ok(VolkskreditbankAg),
9910 "vr_bank_braunau" => Ok(VrBankBraunau),
9911 v => {
9912 tracing::warn!(
9913 "Unknown value '{}' for enum '{}'",
9914 v,
9915 "ConfirmSetupIntentPaymentMethodDataEpsBank"
9916 );
9917 Ok(Unknown(v.to_owned()))
9918 }
9919 }
9920 }
9921}
9922impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
9923 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9924 f.write_str(self.as_str())
9925 }
9926}
9927
9928impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
9929 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9930 f.write_str(self.as_str())
9931 }
9932}
9933impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
9934 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9935 where
9936 S: serde::Serializer,
9937 {
9938 serializer.serialize_str(self.as_str())
9939 }
9940}
9941#[cfg(feature = "deserialize")]
9942impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
9943 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9944 use std::str::FromStr;
9945 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9946 Ok(Self::from_str(&s).expect("infallible"))
9947 }
9948}
9949#[derive(Clone, Debug, serde::Serialize)]
9951pub struct ConfirmSetupIntentPaymentMethodDataFpx {
9952 #[serde(skip_serializing_if = "Option::is_none")]
9954 pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
9955 pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
9957}
9958impl ConfirmSetupIntentPaymentMethodDataFpx {
9959 pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
9960 Self { account_holder_type: None, bank: bank.into() }
9961 }
9962}
9963#[derive(Clone, Eq, PartialEq)]
9965#[non_exhaustive]
9966pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9967 Company,
9968 Individual,
9969 Unknown(String),
9971}
9972impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9973 pub fn as_str(&self) -> &str {
9974 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9975 match self {
9976 Company => "company",
9977 Individual => "individual",
9978 Unknown(v) => v,
9979 }
9980 }
9981}
9982
9983impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9984 type Err = std::convert::Infallible;
9985 fn from_str(s: &str) -> Result<Self, Self::Err> {
9986 use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9987 match s {
9988 "company" => Ok(Company),
9989 "individual" => Ok(Individual),
9990 v => {
9991 tracing::warn!(
9992 "Unknown value '{}' for enum '{}'",
9993 v,
9994 "ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType"
9995 );
9996 Ok(Unknown(v.to_owned()))
9997 }
9998 }
9999 }
10000}
10001impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10002 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10003 f.write_str(self.as_str())
10004 }
10005}
10006
10007impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10008 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10009 f.write_str(self.as_str())
10010 }
10011}
10012impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10013 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10014 where
10015 S: serde::Serializer,
10016 {
10017 serializer.serialize_str(self.as_str())
10018 }
10019}
10020#[cfg(feature = "deserialize")]
10021impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10022 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10023 use std::str::FromStr;
10024 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10025 Ok(Self::from_str(&s).expect("infallible"))
10026 }
10027}
10028#[derive(Clone, Eq, PartialEq)]
10030#[non_exhaustive]
10031pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
10032 AffinBank,
10033 Agrobank,
10034 AllianceBank,
10035 Ambank,
10036 BankIslam,
10037 BankMuamalat,
10038 BankOfChina,
10039 BankRakyat,
10040 Bsn,
10041 Cimb,
10042 DeutscheBank,
10043 HongLeongBank,
10044 Hsbc,
10045 Kfh,
10046 Maybank2e,
10047 Maybank2u,
10048 Ocbc,
10049 PbEnterprise,
10050 PublicBank,
10051 Rhb,
10052 StandardChartered,
10053 Uob,
10054 Unknown(String),
10056}
10057impl ConfirmSetupIntentPaymentMethodDataFpxBank {
10058 pub fn as_str(&self) -> &str {
10059 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
10060 match self {
10061 AffinBank => "affin_bank",
10062 Agrobank => "agrobank",
10063 AllianceBank => "alliance_bank",
10064 Ambank => "ambank",
10065 BankIslam => "bank_islam",
10066 BankMuamalat => "bank_muamalat",
10067 BankOfChina => "bank_of_china",
10068 BankRakyat => "bank_rakyat",
10069 Bsn => "bsn",
10070 Cimb => "cimb",
10071 DeutscheBank => "deutsche_bank",
10072 HongLeongBank => "hong_leong_bank",
10073 Hsbc => "hsbc",
10074 Kfh => "kfh",
10075 Maybank2e => "maybank2e",
10076 Maybank2u => "maybank2u",
10077 Ocbc => "ocbc",
10078 PbEnterprise => "pb_enterprise",
10079 PublicBank => "public_bank",
10080 Rhb => "rhb",
10081 StandardChartered => "standard_chartered",
10082 Uob => "uob",
10083 Unknown(v) => v,
10084 }
10085 }
10086}
10087
10088impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
10089 type Err = std::convert::Infallible;
10090 fn from_str(s: &str) -> Result<Self, Self::Err> {
10091 use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
10092 match s {
10093 "affin_bank" => Ok(AffinBank),
10094 "agrobank" => Ok(Agrobank),
10095 "alliance_bank" => Ok(AllianceBank),
10096 "ambank" => Ok(Ambank),
10097 "bank_islam" => Ok(BankIslam),
10098 "bank_muamalat" => Ok(BankMuamalat),
10099 "bank_of_china" => Ok(BankOfChina),
10100 "bank_rakyat" => Ok(BankRakyat),
10101 "bsn" => Ok(Bsn),
10102 "cimb" => Ok(Cimb),
10103 "deutsche_bank" => Ok(DeutscheBank),
10104 "hong_leong_bank" => Ok(HongLeongBank),
10105 "hsbc" => Ok(Hsbc),
10106 "kfh" => Ok(Kfh),
10107 "maybank2e" => Ok(Maybank2e),
10108 "maybank2u" => Ok(Maybank2u),
10109 "ocbc" => Ok(Ocbc),
10110 "pb_enterprise" => Ok(PbEnterprise),
10111 "public_bank" => Ok(PublicBank),
10112 "rhb" => Ok(Rhb),
10113 "standard_chartered" => Ok(StandardChartered),
10114 "uob" => Ok(Uob),
10115 v => {
10116 tracing::warn!(
10117 "Unknown value '{}' for enum '{}'",
10118 v,
10119 "ConfirmSetupIntentPaymentMethodDataFpxBank"
10120 );
10121 Ok(Unknown(v.to_owned()))
10122 }
10123 }
10124 }
10125}
10126impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
10127 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10128 f.write_str(self.as_str())
10129 }
10130}
10131
10132impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
10133 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10134 f.write_str(self.as_str())
10135 }
10136}
10137impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
10138 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10139 where
10140 S: serde::Serializer,
10141 {
10142 serializer.serialize_str(self.as_str())
10143 }
10144}
10145#[cfg(feature = "deserialize")]
10146impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
10147 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10148 use std::str::FromStr;
10149 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10150 Ok(Self::from_str(&s).expect("infallible"))
10151 }
10152}
10153#[derive(Clone, Debug, serde::Serialize)]
10155pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
10156 #[serde(skip_serializing_if = "Option::is_none")]
10160 pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
10161}
10162impl ConfirmSetupIntentPaymentMethodDataIdeal {
10163 pub fn new() -> Self {
10164 Self { bank: None }
10165 }
10166}
10167impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
10168 fn default() -> Self {
10169 Self::new()
10170 }
10171}
10172#[derive(Clone, Eq, PartialEq)]
10176#[non_exhaustive]
10177pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
10178 AbnAmro,
10179 AsnBank,
10180 Bunq,
10181 Buut,
10182 Finom,
10183 Handelsbanken,
10184 Ing,
10185 Knab,
10186 Moneyou,
10187 N26,
10188 Nn,
10189 Rabobank,
10190 Regiobank,
10191 Revolut,
10192 SnsBank,
10193 TriodosBank,
10194 VanLanschot,
10195 Yoursafe,
10196 Unknown(String),
10198}
10199impl ConfirmSetupIntentPaymentMethodDataIdealBank {
10200 pub fn as_str(&self) -> &str {
10201 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
10202 match self {
10203 AbnAmro => "abn_amro",
10204 AsnBank => "asn_bank",
10205 Bunq => "bunq",
10206 Buut => "buut",
10207 Finom => "finom",
10208 Handelsbanken => "handelsbanken",
10209 Ing => "ing",
10210 Knab => "knab",
10211 Moneyou => "moneyou",
10212 N26 => "n26",
10213 Nn => "nn",
10214 Rabobank => "rabobank",
10215 Regiobank => "regiobank",
10216 Revolut => "revolut",
10217 SnsBank => "sns_bank",
10218 TriodosBank => "triodos_bank",
10219 VanLanschot => "van_lanschot",
10220 Yoursafe => "yoursafe",
10221 Unknown(v) => v,
10222 }
10223 }
10224}
10225
10226impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
10227 type Err = std::convert::Infallible;
10228 fn from_str(s: &str) -> Result<Self, Self::Err> {
10229 use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
10230 match s {
10231 "abn_amro" => Ok(AbnAmro),
10232 "asn_bank" => Ok(AsnBank),
10233 "bunq" => Ok(Bunq),
10234 "buut" => Ok(Buut),
10235 "finom" => Ok(Finom),
10236 "handelsbanken" => Ok(Handelsbanken),
10237 "ing" => Ok(Ing),
10238 "knab" => Ok(Knab),
10239 "moneyou" => Ok(Moneyou),
10240 "n26" => Ok(N26),
10241 "nn" => Ok(Nn),
10242 "rabobank" => Ok(Rabobank),
10243 "regiobank" => Ok(Regiobank),
10244 "revolut" => Ok(Revolut),
10245 "sns_bank" => Ok(SnsBank),
10246 "triodos_bank" => Ok(TriodosBank),
10247 "van_lanschot" => Ok(VanLanschot),
10248 "yoursafe" => Ok(Yoursafe),
10249 v => {
10250 tracing::warn!(
10251 "Unknown value '{}' for enum '{}'",
10252 v,
10253 "ConfirmSetupIntentPaymentMethodDataIdealBank"
10254 );
10255 Ok(Unknown(v.to_owned()))
10256 }
10257 }
10258 }
10259}
10260impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
10261 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10262 f.write_str(self.as_str())
10263 }
10264}
10265
10266impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
10267 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10268 f.write_str(self.as_str())
10269 }
10270}
10271impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
10272 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10273 where
10274 S: serde::Serializer,
10275 {
10276 serializer.serialize_str(self.as_str())
10277 }
10278}
10279#[cfg(feature = "deserialize")]
10280impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
10281 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10282 use std::str::FromStr;
10283 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10284 Ok(Self::from_str(&s).expect("infallible"))
10285 }
10286}
10287#[derive(Copy, Clone, Debug, serde::Serialize)]
10289pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
10290 #[serde(skip_serializing_if = "Option::is_none")]
10292 pub dob: Option<DateOfBirth>,
10293}
10294impl ConfirmSetupIntentPaymentMethodDataKlarna {
10295 pub fn new() -> Self {
10296 Self { dob: None }
10297 }
10298}
10299impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
10300 fn default() -> Self {
10301 Self::new()
10302 }
10303}
10304#[derive(Clone, Debug, serde::Serialize)]
10306pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
10307 #[serde(skip_serializing_if = "Option::is_none")]
10310 pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
10311}
10312impl ConfirmSetupIntentPaymentMethodDataNaverPay {
10313 pub fn new() -> Self {
10314 Self { funding: None }
10315 }
10316}
10317impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
10318 fn default() -> Self {
10319 Self::new()
10320 }
10321}
10322#[derive(Clone, Eq, PartialEq)]
10325#[non_exhaustive]
10326pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10327 Card,
10328 Points,
10329 Unknown(String),
10331}
10332impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10333 pub fn as_str(&self) -> &str {
10334 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
10335 match self {
10336 Card => "card",
10337 Points => "points",
10338 Unknown(v) => v,
10339 }
10340 }
10341}
10342
10343impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10344 type Err = std::convert::Infallible;
10345 fn from_str(s: &str) -> Result<Self, Self::Err> {
10346 use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
10347 match s {
10348 "card" => Ok(Card),
10349 "points" => Ok(Points),
10350 v => {
10351 tracing::warn!(
10352 "Unknown value '{}' for enum '{}'",
10353 v,
10354 "ConfirmSetupIntentPaymentMethodDataNaverPayFunding"
10355 );
10356 Ok(Unknown(v.to_owned()))
10357 }
10358 }
10359 }
10360}
10361impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10362 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10363 f.write_str(self.as_str())
10364 }
10365}
10366
10367impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10368 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10369 f.write_str(self.as_str())
10370 }
10371}
10372impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10373 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10374 where
10375 S: serde::Serializer,
10376 {
10377 serializer.serialize_str(self.as_str())
10378 }
10379}
10380#[cfg(feature = "deserialize")]
10381impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
10382 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10383 use std::str::FromStr;
10384 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10385 Ok(Self::from_str(&s).expect("infallible"))
10386 }
10387}
10388#[derive(Clone, Debug, serde::Serialize)]
10390pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
10391 #[serde(skip_serializing_if = "Option::is_none")]
10394 pub account_holder_name: Option<String>,
10395 pub account_number: String,
10397 pub bank_code: String,
10399 pub branch_code: String,
10401 #[serde(skip_serializing_if = "Option::is_none")]
10402 pub reference: Option<String>,
10403 pub suffix: String,
10405}
10406impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
10407 pub fn new(
10408 account_number: impl Into<String>,
10409 bank_code: impl Into<String>,
10410 branch_code: impl Into<String>,
10411 suffix: impl Into<String>,
10412 ) -> Self {
10413 Self {
10414 account_holder_name: None,
10415 account_number: account_number.into(),
10416 bank_code: bank_code.into(),
10417 branch_code: branch_code.into(),
10418 reference: None,
10419 suffix: suffix.into(),
10420 }
10421 }
10422}
10423#[derive(Clone, Debug, serde::Serialize)]
10425pub struct ConfirmSetupIntentPaymentMethodDataP24 {
10426 #[serde(skip_serializing_if = "Option::is_none")]
10428 pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
10429}
10430impl ConfirmSetupIntentPaymentMethodDataP24 {
10431 pub fn new() -> Self {
10432 Self { bank: None }
10433 }
10434}
10435impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
10436 fn default() -> Self {
10437 Self::new()
10438 }
10439}
10440#[derive(Clone, Eq, PartialEq)]
10442#[non_exhaustive]
10443pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
10444 AliorBank,
10445 BankMillennium,
10446 BankNowyBfgSa,
10447 BankPekaoSa,
10448 BankiSpbdzielcze,
10449 Blik,
10450 BnpParibas,
10451 Boz,
10452 CitiHandlowy,
10453 CreditAgricole,
10454 Envelobank,
10455 EtransferPocztowy24,
10456 GetinBank,
10457 Ideabank,
10458 Ing,
10459 Inteligo,
10460 MbankMtransfer,
10461 NestPrzelew,
10462 NoblePay,
10463 PbacZIpko,
10464 PlusBank,
10465 SantanderPrzelew24,
10466 TmobileUsbugiBankowe,
10467 ToyotaBank,
10468 Velobank,
10469 VolkswagenBank,
10470 Unknown(String),
10472}
10473impl ConfirmSetupIntentPaymentMethodDataP24Bank {
10474 pub fn as_str(&self) -> &str {
10475 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
10476 match self {
10477 AliorBank => "alior_bank",
10478 BankMillennium => "bank_millennium",
10479 BankNowyBfgSa => "bank_nowy_bfg_sa",
10480 BankPekaoSa => "bank_pekao_sa",
10481 BankiSpbdzielcze => "banki_spbdzielcze",
10482 Blik => "blik",
10483 BnpParibas => "bnp_paribas",
10484 Boz => "boz",
10485 CitiHandlowy => "citi_handlowy",
10486 CreditAgricole => "credit_agricole",
10487 Envelobank => "envelobank",
10488 EtransferPocztowy24 => "etransfer_pocztowy24",
10489 GetinBank => "getin_bank",
10490 Ideabank => "ideabank",
10491 Ing => "ing",
10492 Inteligo => "inteligo",
10493 MbankMtransfer => "mbank_mtransfer",
10494 NestPrzelew => "nest_przelew",
10495 NoblePay => "noble_pay",
10496 PbacZIpko => "pbac_z_ipko",
10497 PlusBank => "plus_bank",
10498 SantanderPrzelew24 => "santander_przelew24",
10499 TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
10500 ToyotaBank => "toyota_bank",
10501 Velobank => "velobank",
10502 VolkswagenBank => "volkswagen_bank",
10503 Unknown(v) => v,
10504 }
10505 }
10506}
10507
10508impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
10509 type Err = std::convert::Infallible;
10510 fn from_str(s: &str) -> Result<Self, Self::Err> {
10511 use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
10512 match s {
10513 "alior_bank" => Ok(AliorBank),
10514 "bank_millennium" => Ok(BankMillennium),
10515 "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
10516 "bank_pekao_sa" => Ok(BankPekaoSa),
10517 "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
10518 "blik" => Ok(Blik),
10519 "bnp_paribas" => Ok(BnpParibas),
10520 "boz" => Ok(Boz),
10521 "citi_handlowy" => Ok(CitiHandlowy),
10522 "credit_agricole" => Ok(CreditAgricole),
10523 "envelobank" => Ok(Envelobank),
10524 "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
10525 "getin_bank" => Ok(GetinBank),
10526 "ideabank" => Ok(Ideabank),
10527 "ing" => Ok(Ing),
10528 "inteligo" => Ok(Inteligo),
10529 "mbank_mtransfer" => Ok(MbankMtransfer),
10530 "nest_przelew" => Ok(NestPrzelew),
10531 "noble_pay" => Ok(NoblePay),
10532 "pbac_z_ipko" => Ok(PbacZIpko),
10533 "plus_bank" => Ok(PlusBank),
10534 "santander_przelew24" => Ok(SantanderPrzelew24),
10535 "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
10536 "toyota_bank" => Ok(ToyotaBank),
10537 "velobank" => Ok(Velobank),
10538 "volkswagen_bank" => Ok(VolkswagenBank),
10539 v => {
10540 tracing::warn!(
10541 "Unknown value '{}' for enum '{}'",
10542 v,
10543 "ConfirmSetupIntentPaymentMethodDataP24Bank"
10544 );
10545 Ok(Unknown(v.to_owned()))
10546 }
10547 }
10548 }
10549}
10550impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
10551 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10552 f.write_str(self.as_str())
10553 }
10554}
10555
10556impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
10557 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10558 f.write_str(self.as_str())
10559 }
10560}
10561impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
10562 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10563 where
10564 S: serde::Serializer,
10565 {
10566 serializer.serialize_str(self.as_str())
10567 }
10568}
10569#[cfg(feature = "deserialize")]
10570impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
10571 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10572 use std::str::FromStr;
10573 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10574 Ok(Self::from_str(&s).expect("infallible"))
10575 }
10576}
10577#[derive(Clone, Debug, serde::Serialize)]
10579pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
10580 pub iban: String,
10582}
10583impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
10584 pub fn new(iban: impl Into<String>) -> Self {
10585 Self { iban: iban.into() }
10586 }
10587}
10588#[derive(Clone, Debug, serde::Serialize)]
10590pub struct ConfirmSetupIntentPaymentMethodDataSofort {
10591 pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
10593}
10594impl ConfirmSetupIntentPaymentMethodDataSofort {
10595 pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
10596 Self { country: country.into() }
10597 }
10598}
10599#[derive(Clone, Eq, PartialEq)]
10601#[non_exhaustive]
10602pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
10603 At,
10604 Be,
10605 De,
10606 Es,
10607 It,
10608 Nl,
10609 Unknown(String),
10611}
10612impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
10613 pub fn as_str(&self) -> &str {
10614 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
10615 match self {
10616 At => "AT",
10617 Be => "BE",
10618 De => "DE",
10619 Es => "ES",
10620 It => "IT",
10621 Nl => "NL",
10622 Unknown(v) => v,
10623 }
10624 }
10625}
10626
10627impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
10628 type Err = std::convert::Infallible;
10629 fn from_str(s: &str) -> Result<Self, Self::Err> {
10630 use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
10631 match s {
10632 "AT" => Ok(At),
10633 "BE" => Ok(Be),
10634 "DE" => Ok(De),
10635 "ES" => Ok(Es),
10636 "IT" => Ok(It),
10637 "NL" => Ok(Nl),
10638 v => {
10639 tracing::warn!(
10640 "Unknown value '{}' for enum '{}'",
10641 v,
10642 "ConfirmSetupIntentPaymentMethodDataSofortCountry"
10643 );
10644 Ok(Unknown(v.to_owned()))
10645 }
10646 }
10647 }
10648}
10649impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
10650 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10651 f.write_str(self.as_str())
10652 }
10653}
10654
10655impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
10656 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10657 f.write_str(self.as_str())
10658 }
10659}
10660impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
10661 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10662 where
10663 S: serde::Serializer,
10664 {
10665 serializer.serialize_str(self.as_str())
10666 }
10667}
10668#[cfg(feature = "deserialize")]
10669impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
10670 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10671 use std::str::FromStr;
10672 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10673 Ok(Self::from_str(&s).expect("infallible"))
10674 }
10675}
10676#[derive(Clone, Eq, PartialEq)]
10680#[non_exhaustive]
10681pub enum ConfirmSetupIntentPaymentMethodDataType {
10682 AcssDebit,
10683 Affirm,
10684 AfterpayClearpay,
10685 Alipay,
10686 Alma,
10687 AmazonPay,
10688 AuBecsDebit,
10689 BacsDebit,
10690 Bancontact,
10691 Billie,
10692 Blik,
10693 Boleto,
10694 Cashapp,
10695 Crypto,
10696 CustomerBalance,
10697 Eps,
10698 Fpx,
10699 Giropay,
10700 Grabpay,
10701 Ideal,
10702 KakaoPay,
10703 Klarna,
10704 Konbini,
10705 KrCard,
10706 Link,
10707 MbWay,
10708 Mobilepay,
10709 Multibanco,
10710 NaverPay,
10711 NzBankAccount,
10712 Oxxo,
10713 P24,
10714 PayByBank,
10715 Payco,
10716 Paynow,
10717 Paypal,
10718 Pix,
10719 Promptpay,
10720 RevolutPay,
10721 SamsungPay,
10722 Satispay,
10723 SepaDebit,
10724 Sofort,
10725 Swish,
10726 Twint,
10727 UsBankAccount,
10728 WechatPay,
10729 Zip,
10730 Unknown(String),
10732}
10733impl ConfirmSetupIntentPaymentMethodDataType {
10734 pub fn as_str(&self) -> &str {
10735 use ConfirmSetupIntentPaymentMethodDataType::*;
10736 match self {
10737 AcssDebit => "acss_debit",
10738 Affirm => "affirm",
10739 AfterpayClearpay => "afterpay_clearpay",
10740 Alipay => "alipay",
10741 Alma => "alma",
10742 AmazonPay => "amazon_pay",
10743 AuBecsDebit => "au_becs_debit",
10744 BacsDebit => "bacs_debit",
10745 Bancontact => "bancontact",
10746 Billie => "billie",
10747 Blik => "blik",
10748 Boleto => "boleto",
10749 Cashapp => "cashapp",
10750 Crypto => "crypto",
10751 CustomerBalance => "customer_balance",
10752 Eps => "eps",
10753 Fpx => "fpx",
10754 Giropay => "giropay",
10755 Grabpay => "grabpay",
10756 Ideal => "ideal",
10757 KakaoPay => "kakao_pay",
10758 Klarna => "klarna",
10759 Konbini => "konbini",
10760 KrCard => "kr_card",
10761 Link => "link",
10762 MbWay => "mb_way",
10763 Mobilepay => "mobilepay",
10764 Multibanco => "multibanco",
10765 NaverPay => "naver_pay",
10766 NzBankAccount => "nz_bank_account",
10767 Oxxo => "oxxo",
10768 P24 => "p24",
10769 PayByBank => "pay_by_bank",
10770 Payco => "payco",
10771 Paynow => "paynow",
10772 Paypal => "paypal",
10773 Pix => "pix",
10774 Promptpay => "promptpay",
10775 RevolutPay => "revolut_pay",
10776 SamsungPay => "samsung_pay",
10777 Satispay => "satispay",
10778 SepaDebit => "sepa_debit",
10779 Sofort => "sofort",
10780 Swish => "swish",
10781 Twint => "twint",
10782 UsBankAccount => "us_bank_account",
10783 WechatPay => "wechat_pay",
10784 Zip => "zip",
10785 Unknown(v) => v,
10786 }
10787 }
10788}
10789
10790impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
10791 type Err = std::convert::Infallible;
10792 fn from_str(s: &str) -> Result<Self, Self::Err> {
10793 use ConfirmSetupIntentPaymentMethodDataType::*;
10794 match s {
10795 "acss_debit" => Ok(AcssDebit),
10796 "affirm" => Ok(Affirm),
10797 "afterpay_clearpay" => Ok(AfterpayClearpay),
10798 "alipay" => Ok(Alipay),
10799 "alma" => Ok(Alma),
10800 "amazon_pay" => Ok(AmazonPay),
10801 "au_becs_debit" => Ok(AuBecsDebit),
10802 "bacs_debit" => Ok(BacsDebit),
10803 "bancontact" => Ok(Bancontact),
10804 "billie" => Ok(Billie),
10805 "blik" => Ok(Blik),
10806 "boleto" => Ok(Boleto),
10807 "cashapp" => Ok(Cashapp),
10808 "crypto" => Ok(Crypto),
10809 "customer_balance" => Ok(CustomerBalance),
10810 "eps" => Ok(Eps),
10811 "fpx" => Ok(Fpx),
10812 "giropay" => Ok(Giropay),
10813 "grabpay" => Ok(Grabpay),
10814 "ideal" => Ok(Ideal),
10815 "kakao_pay" => Ok(KakaoPay),
10816 "klarna" => Ok(Klarna),
10817 "konbini" => Ok(Konbini),
10818 "kr_card" => Ok(KrCard),
10819 "link" => Ok(Link),
10820 "mb_way" => Ok(MbWay),
10821 "mobilepay" => Ok(Mobilepay),
10822 "multibanco" => Ok(Multibanco),
10823 "naver_pay" => Ok(NaverPay),
10824 "nz_bank_account" => Ok(NzBankAccount),
10825 "oxxo" => Ok(Oxxo),
10826 "p24" => Ok(P24),
10827 "pay_by_bank" => Ok(PayByBank),
10828 "payco" => Ok(Payco),
10829 "paynow" => Ok(Paynow),
10830 "paypal" => Ok(Paypal),
10831 "pix" => Ok(Pix),
10832 "promptpay" => Ok(Promptpay),
10833 "revolut_pay" => Ok(RevolutPay),
10834 "samsung_pay" => Ok(SamsungPay),
10835 "satispay" => Ok(Satispay),
10836 "sepa_debit" => Ok(SepaDebit),
10837 "sofort" => Ok(Sofort),
10838 "swish" => Ok(Swish),
10839 "twint" => Ok(Twint),
10840 "us_bank_account" => Ok(UsBankAccount),
10841 "wechat_pay" => Ok(WechatPay),
10842 "zip" => Ok(Zip),
10843 v => {
10844 tracing::warn!(
10845 "Unknown value '{}' for enum '{}'",
10846 v,
10847 "ConfirmSetupIntentPaymentMethodDataType"
10848 );
10849 Ok(Unknown(v.to_owned()))
10850 }
10851 }
10852 }
10853}
10854impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
10855 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10856 f.write_str(self.as_str())
10857 }
10858}
10859
10860impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
10861 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10862 f.write_str(self.as_str())
10863 }
10864}
10865impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
10866 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10867 where
10868 S: serde::Serializer,
10869 {
10870 serializer.serialize_str(self.as_str())
10871 }
10872}
10873#[cfg(feature = "deserialize")]
10874impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
10875 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10876 use std::str::FromStr;
10877 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10878 Ok(Self::from_str(&s).expect("infallible"))
10879 }
10880}
10881#[derive(Clone, Debug, serde::Serialize)]
10883pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10884 #[serde(skip_serializing_if = "Option::is_none")]
10886 pub account_holder_type:
10887 Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
10888 #[serde(skip_serializing_if = "Option::is_none")]
10890 pub account_number: Option<String>,
10891 #[serde(skip_serializing_if = "Option::is_none")]
10893 pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
10894 #[serde(skip_serializing_if = "Option::is_none")]
10896 pub financial_connections_account: Option<String>,
10897 #[serde(skip_serializing_if = "Option::is_none")]
10899 pub routing_number: Option<String>,
10900}
10901impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10902 pub fn new() -> Self {
10903 Self {
10904 account_holder_type: None,
10905 account_number: None,
10906 account_type: None,
10907 financial_connections_account: None,
10908 routing_number: None,
10909 }
10910 }
10911}
10912impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10913 fn default() -> Self {
10914 Self::new()
10915 }
10916}
10917#[derive(Clone, Eq, PartialEq)]
10919#[non_exhaustive]
10920pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10921 Company,
10922 Individual,
10923 Unknown(String),
10925}
10926impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10927 pub fn as_str(&self) -> &str {
10928 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10929 match self {
10930 Company => "company",
10931 Individual => "individual",
10932 Unknown(v) => v,
10933 }
10934 }
10935}
10936
10937impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10938 type Err = std::convert::Infallible;
10939 fn from_str(s: &str) -> Result<Self, Self::Err> {
10940 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10941 match s {
10942 "company" => Ok(Company),
10943 "individual" => Ok(Individual),
10944 v => {
10945 tracing::warn!(
10946 "Unknown value '{}' for enum '{}'",
10947 v,
10948 "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
10949 );
10950 Ok(Unknown(v.to_owned()))
10951 }
10952 }
10953 }
10954}
10955impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10956 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10957 f.write_str(self.as_str())
10958 }
10959}
10960
10961impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10962 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10963 f.write_str(self.as_str())
10964 }
10965}
10966impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10967 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10968 where
10969 S: serde::Serializer,
10970 {
10971 serializer.serialize_str(self.as_str())
10972 }
10973}
10974#[cfg(feature = "deserialize")]
10975impl<'de> serde::Deserialize<'de>
10976 for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
10977{
10978 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10979 use std::str::FromStr;
10980 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10981 Ok(Self::from_str(&s).expect("infallible"))
10982 }
10983}
10984#[derive(Clone, Eq, PartialEq)]
10986#[non_exhaustive]
10987pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10988 Checking,
10989 Savings,
10990 Unknown(String),
10992}
10993impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10994 pub fn as_str(&self) -> &str {
10995 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10996 match self {
10997 Checking => "checking",
10998 Savings => "savings",
10999 Unknown(v) => v,
11000 }
11001 }
11002}
11003
11004impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11005 type Err = std::convert::Infallible;
11006 fn from_str(s: &str) -> Result<Self, Self::Err> {
11007 use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
11008 match s {
11009 "checking" => Ok(Checking),
11010 "savings" => Ok(Savings),
11011 v => {
11012 tracing::warn!(
11013 "Unknown value '{}' for enum '{}'",
11014 v,
11015 "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType"
11016 );
11017 Ok(Unknown(v.to_owned()))
11018 }
11019 }
11020 }
11021}
11022impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11023 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11024 f.write_str(self.as_str())
11025 }
11026}
11027
11028impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11029 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11030 f.write_str(self.as_str())
11031 }
11032}
11033impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11034 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11035 where
11036 S: serde::Serializer,
11037 {
11038 serializer.serialize_str(self.as_str())
11039 }
11040}
11041#[cfg(feature = "deserialize")]
11042impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11043 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11044 use std::str::FromStr;
11045 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11046 Ok(Self::from_str(&s).expect("infallible"))
11047 }
11048}
11049#[derive(Clone, Debug, serde::Serialize)]
11051pub struct ConfirmSetupIntentPaymentMethodOptions {
11052 #[serde(skip_serializing_if = "Option::is_none")]
11054 pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
11055 #[serde(skip_serializing_if = "Option::is_none")]
11057 #[serde(with = "stripe_types::with_serde_json_opt")]
11058 pub amazon_pay: Option<miniserde::json::Value>,
11059 #[serde(skip_serializing_if = "Option::is_none")]
11061 pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
11062 #[serde(skip_serializing_if = "Option::is_none")]
11064 pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
11065 #[serde(skip_serializing_if = "Option::is_none")]
11067 #[serde(with = "stripe_types::with_serde_json_opt")]
11068 pub card_present: Option<miniserde::json::Value>,
11069 #[serde(skip_serializing_if = "Option::is_none")]
11071 pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
11072 #[serde(skip_serializing_if = "Option::is_none")]
11074 pub link: Option<SetupIntentPaymentMethodOptionsParam>,
11075 #[serde(skip_serializing_if = "Option::is_none")]
11077 pub paypal: Option<PaymentMethodOptionsParam>,
11078 #[serde(skip_serializing_if = "Option::is_none")]
11080 pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
11081 #[serde(skip_serializing_if = "Option::is_none")]
11083 pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
11084}
11085impl ConfirmSetupIntentPaymentMethodOptions {
11086 pub fn new() -> Self {
11087 Self {
11088 acss_debit: None,
11089 amazon_pay: None,
11090 bacs_debit: None,
11091 card: None,
11092 card_present: None,
11093 klarna: None,
11094 link: None,
11095 paypal: None,
11096 sepa_debit: None,
11097 us_bank_account: None,
11098 }
11099 }
11100}
11101impl Default for ConfirmSetupIntentPaymentMethodOptions {
11102 fn default() -> Self {
11103 Self::new()
11104 }
11105}
11106#[derive(Clone, Debug, serde::Serialize)]
11108pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11109 #[serde(skip_serializing_if = "Option::is_none")]
11112 pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
11113 #[serde(skip_serializing_if = "Option::is_none")]
11115 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
11116 #[serde(skip_serializing_if = "Option::is_none")]
11118 pub verification_method:
11119 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
11120}
11121impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11122 pub fn new() -> Self {
11123 Self { currency: None, mandate_options: None, verification_method: None }
11124 }
11125}
11126impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11127 fn default() -> Self {
11128 Self::new()
11129 }
11130}
11131#[derive(Clone, Eq, PartialEq)]
11134#[non_exhaustive]
11135pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11136 Cad,
11137 Usd,
11138 Unknown(String),
11140}
11141impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11142 pub fn as_str(&self) -> &str {
11143 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
11144 match self {
11145 Cad => "cad",
11146 Usd => "usd",
11147 Unknown(v) => v,
11148 }
11149 }
11150}
11151
11152impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11153 type Err = std::convert::Infallible;
11154 fn from_str(s: &str) -> Result<Self, Self::Err> {
11155 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
11156 match s {
11157 "cad" => Ok(Cad),
11158 "usd" => Ok(Usd),
11159 v => {
11160 tracing::warn!(
11161 "Unknown value '{}' for enum '{}'",
11162 v,
11163 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency"
11164 );
11165 Ok(Unknown(v.to_owned()))
11166 }
11167 }
11168 }
11169}
11170impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11171 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11172 f.write_str(self.as_str())
11173 }
11174}
11175
11176impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11177 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11178 f.write_str(self.as_str())
11179 }
11180}
11181impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11182 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11183 where
11184 S: serde::Serializer,
11185 {
11186 serializer.serialize_str(self.as_str())
11187 }
11188}
11189#[cfg(feature = "deserialize")]
11190impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11191 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11192 use std::str::FromStr;
11193 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11194 Ok(Self::from_str(&s).expect("infallible"))
11195 }
11196}
11197#[derive(Clone, Debug, serde::Serialize)]
11199pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
11200 #[serde(skip_serializing_if = "Option::is_none")]
11204 pub custom_mandate_url: Option<String>,
11205 #[serde(skip_serializing_if = "Option::is_none")]
11207 pub default_for:
11208 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
11209 #[serde(skip_serializing_if = "Option::is_none")]
11212 pub interval_description: Option<String>,
11213 #[serde(skip_serializing_if = "Option::is_none")]
11215 pub payment_schedule:
11216 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
11217 #[serde(skip_serializing_if = "Option::is_none")]
11219 pub transaction_type:
11220 Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
11221}
11222impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
11223 pub fn new() -> Self {
11224 Self {
11225 custom_mandate_url: None,
11226 default_for: None,
11227 interval_description: None,
11228 payment_schedule: None,
11229 transaction_type: None,
11230 }
11231 }
11232}
11233impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
11234 fn default() -> Self {
11235 Self::new()
11236 }
11237}
11238#[derive(Clone, Eq, PartialEq)]
11240#[non_exhaustive]
11241pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11242 Invoice,
11243 Subscription,
11244 Unknown(String),
11246}
11247impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11248 pub fn as_str(&self) -> &str {
11249 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
11250 match self {
11251 Invoice => "invoice",
11252 Subscription => "subscription",
11253 Unknown(v) => v,
11254 }
11255 }
11256}
11257
11258impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11259 type Err = std::convert::Infallible;
11260 fn from_str(s: &str) -> Result<Self, Self::Err> {
11261 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
11262 match s {
11263 "invoice" => Ok(Invoice),
11264 "subscription" => Ok(Subscription),
11265 v => {
11266 tracing::warn!(
11267 "Unknown value '{}' for enum '{}'",
11268 v,
11269 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
11270 );
11271 Ok(Unknown(v.to_owned()))
11272 }
11273 }
11274 }
11275}
11276impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11277 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11278 f.write_str(self.as_str())
11279 }
11280}
11281
11282impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11283 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11284 f.write_str(self.as_str())
11285 }
11286}
11287impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
11288 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11289 where
11290 S: serde::Serializer,
11291 {
11292 serializer.serialize_str(self.as_str())
11293 }
11294}
11295#[cfg(feature = "deserialize")]
11296impl<'de> serde::Deserialize<'de>
11297 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
11298{
11299 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11300 use std::str::FromStr;
11301 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11302 Ok(Self::from_str(&s).expect("infallible"))
11303 }
11304}
11305#[derive(Clone, Eq, PartialEq)]
11307#[non_exhaustive]
11308pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
11309 Combined,
11310 Interval,
11311 Sporadic,
11312 Unknown(String),
11314}
11315impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
11316 pub fn as_str(&self) -> &str {
11317 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
11318 match self {
11319 Combined => "combined",
11320 Interval => "interval",
11321 Sporadic => "sporadic",
11322 Unknown(v) => v,
11323 }
11324 }
11325}
11326
11327impl std::str::FromStr
11328 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
11329{
11330 type Err = std::convert::Infallible;
11331 fn from_str(s: &str) -> Result<Self, Self::Err> {
11332 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
11333 match s {
11334 "combined" => Ok(Combined),
11335 "interval" => Ok(Interval),
11336 "sporadic" => Ok(Sporadic),
11337 v => {
11338 tracing::warn!(
11339 "Unknown value '{}' for enum '{}'",
11340 v,
11341 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
11342 );
11343 Ok(Unknown(v.to_owned()))
11344 }
11345 }
11346 }
11347}
11348impl std::fmt::Display
11349 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
11350{
11351 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11352 f.write_str(self.as_str())
11353 }
11354}
11355
11356impl std::fmt::Debug
11357 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
11358{
11359 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11360 f.write_str(self.as_str())
11361 }
11362}
11363impl serde::Serialize
11364 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
11365{
11366 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11367 where
11368 S: serde::Serializer,
11369 {
11370 serializer.serialize_str(self.as_str())
11371 }
11372}
11373#[cfg(feature = "deserialize")]
11374impl<'de> serde::Deserialize<'de>
11375 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
11376{
11377 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11378 use std::str::FromStr;
11379 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11380 Ok(Self::from_str(&s).expect("infallible"))
11381 }
11382}
11383#[derive(Clone, Eq, PartialEq)]
11385#[non_exhaustive]
11386pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
11387 Business,
11388 Personal,
11389 Unknown(String),
11391}
11392impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
11393 pub fn as_str(&self) -> &str {
11394 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
11395 match self {
11396 Business => "business",
11397 Personal => "personal",
11398 Unknown(v) => v,
11399 }
11400 }
11401}
11402
11403impl std::str::FromStr
11404 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
11405{
11406 type Err = std::convert::Infallible;
11407 fn from_str(s: &str) -> Result<Self, Self::Err> {
11408 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
11409 match s {
11410 "business" => Ok(Business),
11411 "personal" => Ok(Personal),
11412 v => {
11413 tracing::warn!(
11414 "Unknown value '{}' for enum '{}'",
11415 v,
11416 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
11417 );
11418 Ok(Unknown(v.to_owned()))
11419 }
11420 }
11421 }
11422}
11423impl std::fmt::Display
11424 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
11425{
11426 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11427 f.write_str(self.as_str())
11428 }
11429}
11430
11431impl std::fmt::Debug
11432 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
11433{
11434 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11435 f.write_str(self.as_str())
11436 }
11437}
11438impl serde::Serialize
11439 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
11440{
11441 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11442 where
11443 S: serde::Serializer,
11444 {
11445 serializer.serialize_str(self.as_str())
11446 }
11447}
11448#[cfg(feature = "deserialize")]
11449impl<'de> serde::Deserialize<'de>
11450 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
11451{
11452 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11453 use std::str::FromStr;
11454 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11455 Ok(Self::from_str(&s).expect("infallible"))
11456 }
11457}
11458#[derive(Clone, Eq, PartialEq)]
11460#[non_exhaustive]
11461pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11462 Automatic,
11463 Instant,
11464 Microdeposits,
11465 Unknown(String),
11467}
11468impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11469 pub fn as_str(&self) -> &str {
11470 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
11471 match self {
11472 Automatic => "automatic",
11473 Instant => "instant",
11474 Microdeposits => "microdeposits",
11475 Unknown(v) => v,
11476 }
11477 }
11478}
11479
11480impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11481 type Err = std::convert::Infallible;
11482 fn from_str(s: &str) -> Result<Self, Self::Err> {
11483 use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
11484 match s {
11485 "automatic" => Ok(Automatic),
11486 "instant" => Ok(Instant),
11487 "microdeposits" => Ok(Microdeposits),
11488 v => {
11489 tracing::warn!(
11490 "Unknown value '{}' for enum '{}'",
11491 v,
11492 "ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
11493 );
11494 Ok(Unknown(v.to_owned()))
11495 }
11496 }
11497 }
11498}
11499impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11500 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11501 f.write_str(self.as_str())
11502 }
11503}
11504
11505impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11506 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11507 f.write_str(self.as_str())
11508 }
11509}
11510impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
11511 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11512 where
11513 S: serde::Serializer,
11514 {
11515 serializer.serialize_str(self.as_str())
11516 }
11517}
11518#[cfg(feature = "deserialize")]
11519impl<'de> serde::Deserialize<'de>
11520 for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
11521{
11522 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11523 use std::str::FromStr;
11524 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11525 Ok(Self::from_str(&s).expect("infallible"))
11526 }
11527}
11528#[derive(Clone, Debug, serde::Serialize)]
11530pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
11531 #[serde(skip_serializing_if = "Option::is_none")]
11533 pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
11534}
11535impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
11536 pub fn new() -> Self {
11537 Self { mandate_options: None }
11538 }
11539}
11540impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
11541 fn default() -> Self {
11542 Self::new()
11543 }
11544}
11545#[derive(Clone, Debug, serde::Serialize)]
11547pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
11548 #[serde(skip_serializing_if = "Option::is_none")]
11550 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
11551 #[serde(skip_serializing_if = "Option::is_none")]
11555 pub moto: Option<bool>,
11556 #[serde(skip_serializing_if = "Option::is_none")]
11560 pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
11561 #[serde(skip_serializing_if = "Option::is_none")]
11566 pub request_three_d_secure:
11567 Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
11568 #[serde(skip_serializing_if = "Option::is_none")]
11571 pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
11572}
11573impl ConfirmSetupIntentPaymentMethodOptionsCard {
11574 pub fn new() -> Self {
11575 Self {
11576 mandate_options: None,
11577 moto: None,
11578 network: None,
11579 request_three_d_secure: None,
11580 three_d_secure: None,
11581 }
11582 }
11583}
11584impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
11585 fn default() -> Self {
11586 Self::new()
11587 }
11588}
11589#[derive(Clone, Debug, serde::Serialize)]
11591pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
11592 pub amount: i64,
11594 pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
11598 pub currency: stripe_types::Currency,
11602 #[serde(skip_serializing_if = "Option::is_none")]
11604 pub description: Option<String>,
11605 #[serde(skip_serializing_if = "Option::is_none")]
11609 pub end_date: Option<stripe_types::Timestamp>,
11610 pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
11612 #[serde(skip_serializing_if = "Option::is_none")]
11617 pub interval_count: Option<u64>,
11618 pub reference: String,
11620 pub start_date: stripe_types::Timestamp,
11622 #[serde(skip_serializing_if = "Option::is_none")]
11624 pub supported_types:
11625 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
11626}
11627impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
11628 pub fn new(
11629 amount: impl Into<i64>,
11630 amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
11631 currency: impl Into<stripe_types::Currency>,
11632 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
11633 reference: impl Into<String>,
11634 start_date: impl Into<stripe_types::Timestamp>,
11635 ) -> Self {
11636 Self {
11637 amount: amount.into(),
11638 amount_type: amount_type.into(),
11639 currency: currency.into(),
11640 description: None,
11641 end_date: None,
11642 interval: interval.into(),
11643 interval_count: None,
11644 reference: reference.into(),
11645 start_date: start_date.into(),
11646 supported_types: None,
11647 }
11648 }
11649}
11650#[derive(Clone, Eq, PartialEq)]
11654#[non_exhaustive]
11655pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11656 Fixed,
11657 Maximum,
11658 Unknown(String),
11660}
11661impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11662 pub fn as_str(&self) -> &str {
11663 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
11664 match self {
11665 Fixed => "fixed",
11666 Maximum => "maximum",
11667 Unknown(v) => v,
11668 }
11669 }
11670}
11671
11672impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11673 type Err = std::convert::Infallible;
11674 fn from_str(s: &str) -> Result<Self, Self::Err> {
11675 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
11676 match s {
11677 "fixed" => Ok(Fixed),
11678 "maximum" => Ok(Maximum),
11679 v => {
11680 tracing::warn!(
11681 "Unknown value '{}' for enum '{}'",
11682 v,
11683 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
11684 );
11685 Ok(Unknown(v.to_owned()))
11686 }
11687 }
11688 }
11689}
11690impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11691 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11692 f.write_str(self.as_str())
11693 }
11694}
11695
11696impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11697 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11698 f.write_str(self.as_str())
11699 }
11700}
11701impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
11702 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11703 where
11704 S: serde::Serializer,
11705 {
11706 serializer.serialize_str(self.as_str())
11707 }
11708}
11709#[cfg(feature = "deserialize")]
11710impl<'de> serde::Deserialize<'de>
11711 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
11712{
11713 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11714 use std::str::FromStr;
11715 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11716 Ok(Self::from_str(&s).expect("infallible"))
11717 }
11718}
11719#[derive(Clone, Eq, PartialEq)]
11721#[non_exhaustive]
11722pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11723 Day,
11724 Month,
11725 Sporadic,
11726 Week,
11727 Year,
11728 Unknown(String),
11730}
11731impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11732 pub fn as_str(&self) -> &str {
11733 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
11734 match self {
11735 Day => "day",
11736 Month => "month",
11737 Sporadic => "sporadic",
11738 Week => "week",
11739 Year => "year",
11740 Unknown(v) => v,
11741 }
11742 }
11743}
11744
11745impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11746 type Err = std::convert::Infallible;
11747 fn from_str(s: &str) -> Result<Self, Self::Err> {
11748 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
11749 match s {
11750 "day" => Ok(Day),
11751 "month" => Ok(Month),
11752 "sporadic" => Ok(Sporadic),
11753 "week" => Ok(Week),
11754 "year" => Ok(Year),
11755 v => {
11756 tracing::warn!(
11757 "Unknown value '{}' for enum '{}'",
11758 v,
11759 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
11760 );
11761 Ok(Unknown(v.to_owned()))
11762 }
11763 }
11764 }
11765}
11766impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11767 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11768 f.write_str(self.as_str())
11769 }
11770}
11771
11772impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11773 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11774 f.write_str(self.as_str())
11775 }
11776}
11777impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
11778 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11779 where
11780 S: serde::Serializer,
11781 {
11782 serializer.serialize_str(self.as_str())
11783 }
11784}
11785#[cfg(feature = "deserialize")]
11786impl<'de> serde::Deserialize<'de>
11787 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
11788{
11789 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11790 use std::str::FromStr;
11791 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11792 Ok(Self::from_str(&s).expect("infallible"))
11793 }
11794}
11795#[derive(Clone, Eq, PartialEq)]
11797#[non_exhaustive]
11798pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11799 India,
11800 Unknown(String),
11802}
11803impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11804 pub fn as_str(&self) -> &str {
11805 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
11806 match self {
11807 India => "india",
11808 Unknown(v) => v,
11809 }
11810 }
11811}
11812
11813impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11814 type Err = std::convert::Infallible;
11815 fn from_str(s: &str) -> Result<Self, Self::Err> {
11816 use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
11817 match s {
11818 "india" => Ok(India),
11819 v => {
11820 tracing::warn!(
11821 "Unknown value '{}' for enum '{}'",
11822 v,
11823 "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
11824 );
11825 Ok(Unknown(v.to_owned()))
11826 }
11827 }
11828 }
11829}
11830impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11831 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11832 f.write_str(self.as_str())
11833 }
11834}
11835
11836impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11837 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11838 f.write_str(self.as_str())
11839 }
11840}
11841impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11842 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11843 where
11844 S: serde::Serializer,
11845 {
11846 serializer.serialize_str(self.as_str())
11847 }
11848}
11849#[cfg(feature = "deserialize")]
11850impl<'de> serde::Deserialize<'de>
11851 for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
11852{
11853 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11854 use std::str::FromStr;
11855 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11856 Ok(Self::from_str(&s).expect("infallible"))
11857 }
11858}
11859#[derive(Clone, Eq, PartialEq)]
11863#[non_exhaustive]
11864pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11865 Amex,
11866 CartesBancaires,
11867 Diners,
11868 Discover,
11869 EftposAu,
11870 Girocard,
11871 Interac,
11872 Jcb,
11873 Link,
11874 Mastercard,
11875 Unionpay,
11876 Unknown,
11877 Visa,
11878 _Unknown(String),
11881}
11882impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11883 pub fn as_str(&self) -> &str {
11884 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11885 match self {
11886 Amex => "amex",
11887 CartesBancaires => "cartes_bancaires",
11888 Diners => "diners",
11889 Discover => "discover",
11890 EftposAu => "eftpos_au",
11891 Girocard => "girocard",
11892 Interac => "interac",
11893 Jcb => "jcb",
11894 Link => "link",
11895 Mastercard => "mastercard",
11896 Unionpay => "unionpay",
11897 Unknown => "unknown",
11898 Visa => "visa",
11899 _Unknown(v) => v,
11900 }
11901 }
11902}
11903
11904impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11905 type Err = std::convert::Infallible;
11906 fn from_str(s: &str) -> Result<Self, Self::Err> {
11907 use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11908 match s {
11909 "amex" => Ok(Amex),
11910 "cartes_bancaires" => Ok(CartesBancaires),
11911 "diners" => Ok(Diners),
11912 "discover" => Ok(Discover),
11913 "eftpos_au" => Ok(EftposAu),
11914 "girocard" => Ok(Girocard),
11915 "interac" => Ok(Interac),
11916 "jcb" => Ok(Jcb),
11917 "link" => Ok(Link),
11918 "mastercard" => Ok(Mastercard),
11919 "unionpay" => Ok(Unionpay),
11920 "unknown" => Ok(Unknown),
11921 "visa" => Ok(Visa),
11922 v => {
11923 tracing::warn!(
11924 "Unknown value '{}' for enum '{}'",
11925 v,
11926 "ConfirmSetupIntentPaymentMethodOptionsCardNetwork"
11927 );
11928 Ok(_Unknown(v.to_owned()))
11929 }
11930 }
11931 }
11932}
11933impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11934 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11935 f.write_str(self.as_str())
11936 }
11937}
11938
11939impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11940 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11941 f.write_str(self.as_str())
11942 }
11943}
11944impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11945 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11946 where
11947 S: serde::Serializer,
11948 {
11949 serializer.serialize_str(self.as_str())
11950 }
11951}
11952#[cfg(feature = "deserialize")]
11953impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11954 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11955 use std::str::FromStr;
11956 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11957 Ok(Self::from_str(&s).expect("infallible"))
11958 }
11959}
11960#[derive(Clone, Eq, PartialEq)]
11965#[non_exhaustive]
11966pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11967 Any,
11968 Automatic,
11969 Challenge,
11970 Unknown(String),
11972}
11973impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11974 pub fn as_str(&self) -> &str {
11975 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11976 match self {
11977 Any => "any",
11978 Automatic => "automatic",
11979 Challenge => "challenge",
11980 Unknown(v) => v,
11981 }
11982 }
11983}
11984
11985impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11986 type Err = std::convert::Infallible;
11987 fn from_str(s: &str) -> Result<Self, Self::Err> {
11988 use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11989 match s {
11990 "any" => Ok(Any),
11991 "automatic" => Ok(Automatic),
11992 "challenge" => Ok(Challenge),
11993 v => {
11994 tracing::warn!(
11995 "Unknown value '{}' for enum '{}'",
11996 v,
11997 "ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
11998 );
11999 Ok(Unknown(v.to_owned()))
12000 }
12001 }
12002 }
12003}
12004impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12005 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12006 f.write_str(self.as_str())
12007 }
12008}
12009
12010impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12011 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12012 f.write_str(self.as_str())
12013 }
12014}
12015impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12016 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12017 where
12018 S: serde::Serializer,
12019 {
12020 serializer.serialize_str(self.as_str())
12021 }
12022}
12023#[cfg(feature = "deserialize")]
12024impl<'de> serde::Deserialize<'de>
12025 for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
12026{
12027 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12028 use std::str::FromStr;
12029 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12030 Ok(Self::from_str(&s).expect("infallible"))
12031 }
12032}
12033#[derive(Clone, Debug, serde::Serialize)]
12036pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12037 #[serde(skip_serializing_if = "Option::is_none")]
12039 pub ares_trans_status:
12040 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
12041 #[serde(skip_serializing_if = "Option::is_none")]
12046 pub cryptogram: Option<String>,
12047 #[serde(skip_serializing_if = "Option::is_none")]
12050 pub electronic_commerce_indicator:
12051 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
12052 #[serde(skip_serializing_if = "Option::is_none")]
12056 pub network_options:
12057 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
12058 #[serde(skip_serializing_if = "Option::is_none")]
12061 pub requestor_challenge_indicator: Option<String>,
12062 #[serde(skip_serializing_if = "Option::is_none")]
12065 pub transaction_id: Option<String>,
12066 #[serde(skip_serializing_if = "Option::is_none")]
12068 pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
12069}
12070impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12071 pub fn new() -> Self {
12072 Self {
12073 ares_trans_status: None,
12074 cryptogram: None,
12075 electronic_commerce_indicator: None,
12076 network_options: None,
12077 requestor_challenge_indicator: None,
12078 transaction_id: None,
12079 version: None,
12080 }
12081 }
12082}
12083impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12084 fn default() -> Self {
12085 Self::new()
12086 }
12087}
12088#[derive(Clone, Eq, PartialEq)]
12090#[non_exhaustive]
12091pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12092 A,
12093 C,
12094 I,
12095 N,
12096 R,
12097 U,
12098 Y,
12099 Unknown(String),
12101}
12102impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12103 pub fn as_str(&self) -> &str {
12104 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
12105 match self {
12106 A => "A",
12107 C => "C",
12108 I => "I",
12109 N => "N",
12110 R => "R",
12111 U => "U",
12112 Y => "Y",
12113 Unknown(v) => v,
12114 }
12115 }
12116}
12117
12118impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12119 type Err = std::convert::Infallible;
12120 fn from_str(s: &str) -> Result<Self, Self::Err> {
12121 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
12122 match s {
12123 "A" => Ok(A),
12124 "C" => Ok(C),
12125 "I" => Ok(I),
12126 "N" => Ok(N),
12127 "R" => Ok(R),
12128 "U" => Ok(U),
12129 "Y" => Ok(Y),
12130 v => {
12131 tracing::warn!(
12132 "Unknown value '{}' for enum '{}'",
12133 v,
12134 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
12135 );
12136 Ok(Unknown(v.to_owned()))
12137 }
12138 }
12139 }
12140}
12141impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12142 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12143 f.write_str(self.as_str())
12144 }
12145}
12146
12147impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12148 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12149 f.write_str(self.as_str())
12150 }
12151}
12152impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12153 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12154 where
12155 S: serde::Serializer,
12156 {
12157 serializer.serialize_str(self.as_str())
12158 }
12159}
12160#[cfg(feature = "deserialize")]
12161impl<'de> serde::Deserialize<'de>
12162 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
12163{
12164 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12165 use std::str::FromStr;
12166 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12167 Ok(Self::from_str(&s).expect("infallible"))
12168 }
12169}
12170#[derive(Clone, Eq, PartialEq)]
12173#[non_exhaustive]
12174pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
12175 V01,
12176 V02,
12177 V05,
12178 V06,
12179 V07,
12180 Unknown(String),
12182}
12183impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
12184 pub fn as_str(&self) -> &str {
12185 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
12186 match self {
12187 V01 => "01",
12188 V02 => "02",
12189 V05 => "05",
12190 V06 => "06",
12191 V07 => "07",
12192 Unknown(v) => v,
12193 }
12194 }
12195}
12196
12197impl std::str::FromStr
12198 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12199{
12200 type Err = std::convert::Infallible;
12201 fn from_str(s: &str) -> Result<Self, Self::Err> {
12202 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
12203 match s {
12204 "01" => Ok(V01),
12205 "02" => Ok(V02),
12206 "05" => Ok(V05),
12207 "06" => Ok(V06),
12208 "07" => Ok(V07),
12209 v => {
12210 tracing::warn!(
12211 "Unknown value '{}' for enum '{}'",
12212 v,
12213 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
12214 );
12215 Ok(Unknown(v.to_owned()))
12216 }
12217 }
12218 }
12219}
12220impl std::fmt::Display
12221 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12222{
12223 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12224 f.write_str(self.as_str())
12225 }
12226}
12227
12228impl std::fmt::Debug
12229 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12230{
12231 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12232 f.write_str(self.as_str())
12233 }
12234}
12235impl serde::Serialize
12236 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12237{
12238 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12239 where
12240 S: serde::Serializer,
12241 {
12242 serializer.serialize_str(self.as_str())
12243 }
12244}
12245#[cfg(feature = "deserialize")]
12246impl<'de> serde::Deserialize<'de>
12247 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12248{
12249 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12250 use std::str::FromStr;
12251 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12252 Ok(Self::from_str(&s).expect("infallible"))
12253 }
12254}
12255#[derive(Clone, Debug, serde::Serialize)]
12259pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
12260 #[serde(skip_serializing_if = "Option::is_none")]
12262 pub cartes_bancaires:
12263 Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
12264}
12265impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
12266 pub fn new() -> Self {
12267 Self { cartes_bancaires: None }
12268 }
12269}
12270impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
12271 fn default() -> Self {
12272 Self::new()
12273 }
12274}
12275#[derive(Clone, Debug, serde::Serialize)]
12277pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
12278 pub cb_avalgo:
12282 ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
12283 #[serde(skip_serializing_if = "Option::is_none")]
12288 pub cb_exemption: Option<String>,
12289 #[serde(skip_serializing_if = "Option::is_none")]
12292 pub cb_score: Option<i64>,
12293}
12294impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
12295 pub fn new(
12296 cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
12297 ) -> Self {
12298 Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
12299 }
12300}
12301#[derive(Clone, Eq, PartialEq)]
12305#[non_exhaustive]
12306pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12307{
12308 V0,
12309 V1,
12310 V2,
12311 V3,
12312 V4,
12313 A,
12314 Unknown(String),
12316}
12317impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
12318 pub fn as_str(&self) -> &str {
12319 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
12320 match self {
12321 V0 => "0",
12322 V1 => "1",
12323 V2 => "2",
12324 V3 => "3",
12325 V4 => "4",
12326 A => "A",
12327 Unknown(v) => v,
12328 }
12329 }
12330}
12331
12332impl std::str::FromStr
12333 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12334{
12335 type Err = std::convert::Infallible;
12336 fn from_str(s: &str) -> Result<Self, Self::Err> {
12337 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
12338 match s {
12339 "0" => Ok(V0),
12340 "1" => Ok(V1),
12341 "2" => Ok(V2),
12342 "3" => Ok(V3),
12343 "4" => Ok(V4),
12344 "A" => Ok(A),
12345 v => {
12346 tracing::warn!(
12347 "Unknown value '{}' for enum '{}'",
12348 v,
12349 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
12350 );
12351 Ok(Unknown(v.to_owned()))
12352 }
12353 }
12354 }
12355}
12356impl std::fmt::Display
12357 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12358{
12359 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12360 f.write_str(self.as_str())
12361 }
12362}
12363
12364impl std::fmt::Debug
12365 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12366{
12367 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12368 f.write_str(self.as_str())
12369 }
12370}
12371impl serde::Serialize
12372 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12373{
12374 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12375 where
12376 S: serde::Serializer,
12377 {
12378 serializer.serialize_str(self.as_str())
12379 }
12380}
12381#[cfg(feature = "deserialize")]
12382impl<'de> serde::Deserialize<'de>
12383 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
12384{
12385 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12386 use std::str::FromStr;
12387 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12388 Ok(Self::from_str(&s).expect("infallible"))
12389 }
12390}
12391#[derive(Clone, Eq, PartialEq)]
12393#[non_exhaustive]
12394pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12395 V1_0_2,
12396 V2_1_0,
12397 V2_2_0,
12398 Unknown(String),
12400}
12401impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12402 pub fn as_str(&self) -> &str {
12403 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
12404 match self {
12405 V1_0_2 => "1.0.2",
12406 V2_1_0 => "2.1.0",
12407 V2_2_0 => "2.2.0",
12408 Unknown(v) => v,
12409 }
12410 }
12411}
12412
12413impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12414 type Err = std::convert::Infallible;
12415 fn from_str(s: &str) -> Result<Self, Self::Err> {
12416 use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
12417 match s {
12418 "1.0.2" => Ok(V1_0_2),
12419 "2.1.0" => Ok(V2_1_0),
12420 "2.2.0" => Ok(V2_2_0),
12421 v => {
12422 tracing::warn!(
12423 "Unknown value '{}' for enum '{}'",
12424 v,
12425 "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
12426 );
12427 Ok(Unknown(v.to_owned()))
12428 }
12429 }
12430 }
12431}
12432impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12433 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12434 f.write_str(self.as_str())
12435 }
12436}
12437
12438impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12439 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12440 f.write_str(self.as_str())
12441 }
12442}
12443impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
12444 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12445 where
12446 S: serde::Serializer,
12447 {
12448 serializer.serialize_str(self.as_str())
12449 }
12450}
12451#[cfg(feature = "deserialize")]
12452impl<'de> serde::Deserialize<'de>
12453 for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
12454{
12455 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12456 use std::str::FromStr;
12457 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12458 Ok(Self::from_str(&s).expect("infallible"))
12459 }
12460}
12461#[derive(Clone, Debug, serde::Serialize)]
12463pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
12464 #[serde(skip_serializing_if = "Option::is_none")]
12466 pub currency: Option<stripe_types::Currency>,
12467 #[serde(skip_serializing_if = "Option::is_none")]
12469 pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
12470 #[serde(skip_serializing_if = "Option::is_none")]
12472 pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
12473 #[serde(skip_serializing_if = "Option::is_none")]
12475 pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
12476}
12477impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
12478 pub fn new() -> Self {
12479 Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
12480 }
12481}
12482impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
12483 fn default() -> Self {
12484 Self::new()
12485 }
12486}
12487#[derive(Clone, Debug, serde::Serialize)]
12489pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
12490 #[serde(skip_serializing_if = "Option::is_none")]
12493 pub average_amount: Option<i64>,
12494 #[serde(skip_serializing_if = "Option::is_none")]
12497 pub maximum_amount: Option<i64>,
12498 #[serde(skip_serializing_if = "Option::is_none")]
12501 pub minimum_amount: Option<i64>,
12502 #[serde(skip_serializing_if = "Option::is_none")]
12504 pub purchase_interval:
12505 Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
12506 #[serde(skip_serializing_if = "Option::is_none")]
12508 pub purchase_interval_count: Option<u64>,
12509}
12510impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
12511 pub fn new() -> Self {
12512 Self {
12513 average_amount: None,
12514 maximum_amount: None,
12515 minimum_amount: None,
12516 purchase_interval: None,
12517 purchase_interval_count: None,
12518 }
12519 }
12520}
12521impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
12522 fn default() -> Self {
12523 Self::new()
12524 }
12525}
12526#[derive(Clone, Eq, PartialEq)]
12528#[non_exhaustive]
12529pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12530 Day,
12531 Month,
12532 Week,
12533 Year,
12534 Unknown(String),
12536}
12537impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12538 pub fn as_str(&self) -> &str {
12539 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
12540 match self {
12541 Day => "day",
12542 Month => "month",
12543 Week => "week",
12544 Year => "year",
12545 Unknown(v) => v,
12546 }
12547 }
12548}
12549
12550impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12551 type Err = std::convert::Infallible;
12552 fn from_str(s: &str) -> Result<Self, Self::Err> {
12553 use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
12554 match s {
12555 "day" => Ok(Day),
12556 "month" => Ok(Month),
12557 "week" => Ok(Week),
12558 "year" => Ok(Year),
12559 v => {
12560 tracing::warn!(
12561 "Unknown value '{}' for enum '{}'",
12562 v,
12563 "ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
12564 );
12565 Ok(Unknown(v.to_owned()))
12566 }
12567 }
12568 }
12569}
12570impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12571 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12572 f.write_str(self.as_str())
12573 }
12574}
12575
12576impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12577 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12578 f.write_str(self.as_str())
12579 }
12580}
12581impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
12582 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12583 where
12584 S: serde::Serializer,
12585 {
12586 serializer.serialize_str(self.as_str())
12587 }
12588}
12589#[cfg(feature = "deserialize")]
12590impl<'de> serde::Deserialize<'de>
12591 for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
12592{
12593 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12594 use std::str::FromStr;
12595 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12596 Ok(Self::from_str(&s).expect("infallible"))
12597 }
12598}
12599#[derive(Clone, Eq, PartialEq)]
12601#[non_exhaustive]
12602pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12603 CsMinusCz,
12604 DaMinusDk,
12605 DeMinusAt,
12606 DeMinusCh,
12607 DeMinusDe,
12608 ElMinusGr,
12609 EnMinusAt,
12610 EnMinusAu,
12611 EnMinusBe,
12612 EnMinusCa,
12613 EnMinusCh,
12614 EnMinusCz,
12615 EnMinusDe,
12616 EnMinusDk,
12617 EnMinusEs,
12618 EnMinusFi,
12619 EnMinusFr,
12620 EnMinusGb,
12621 EnMinusGr,
12622 EnMinusIe,
12623 EnMinusIt,
12624 EnMinusNl,
12625 EnMinusNo,
12626 EnMinusNz,
12627 EnMinusPl,
12628 EnMinusPt,
12629 EnMinusRo,
12630 EnMinusSe,
12631 EnMinusUs,
12632 EsMinusEs,
12633 EsMinusUs,
12634 FiMinusFi,
12635 FrMinusBe,
12636 FrMinusCa,
12637 FrMinusCh,
12638 FrMinusFr,
12639 ItMinusCh,
12640 ItMinusIt,
12641 NbMinusNo,
12642 NlMinusBe,
12643 NlMinusNl,
12644 PlMinusPl,
12645 PtMinusPt,
12646 RoMinusRo,
12647 SvMinusFi,
12648 SvMinusSe,
12649 Unknown(String),
12651}
12652impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12653 pub fn as_str(&self) -> &str {
12654 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
12655 match self {
12656 CsMinusCz => "cs-CZ",
12657 DaMinusDk => "da-DK",
12658 DeMinusAt => "de-AT",
12659 DeMinusCh => "de-CH",
12660 DeMinusDe => "de-DE",
12661 ElMinusGr => "el-GR",
12662 EnMinusAt => "en-AT",
12663 EnMinusAu => "en-AU",
12664 EnMinusBe => "en-BE",
12665 EnMinusCa => "en-CA",
12666 EnMinusCh => "en-CH",
12667 EnMinusCz => "en-CZ",
12668 EnMinusDe => "en-DE",
12669 EnMinusDk => "en-DK",
12670 EnMinusEs => "en-ES",
12671 EnMinusFi => "en-FI",
12672 EnMinusFr => "en-FR",
12673 EnMinusGb => "en-GB",
12674 EnMinusGr => "en-GR",
12675 EnMinusIe => "en-IE",
12676 EnMinusIt => "en-IT",
12677 EnMinusNl => "en-NL",
12678 EnMinusNo => "en-NO",
12679 EnMinusNz => "en-NZ",
12680 EnMinusPl => "en-PL",
12681 EnMinusPt => "en-PT",
12682 EnMinusRo => "en-RO",
12683 EnMinusSe => "en-SE",
12684 EnMinusUs => "en-US",
12685 EsMinusEs => "es-ES",
12686 EsMinusUs => "es-US",
12687 FiMinusFi => "fi-FI",
12688 FrMinusBe => "fr-BE",
12689 FrMinusCa => "fr-CA",
12690 FrMinusCh => "fr-CH",
12691 FrMinusFr => "fr-FR",
12692 ItMinusCh => "it-CH",
12693 ItMinusIt => "it-IT",
12694 NbMinusNo => "nb-NO",
12695 NlMinusBe => "nl-BE",
12696 NlMinusNl => "nl-NL",
12697 PlMinusPl => "pl-PL",
12698 PtMinusPt => "pt-PT",
12699 RoMinusRo => "ro-RO",
12700 SvMinusFi => "sv-FI",
12701 SvMinusSe => "sv-SE",
12702 Unknown(v) => v,
12703 }
12704 }
12705}
12706
12707impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12708 type Err = std::convert::Infallible;
12709 fn from_str(s: &str) -> Result<Self, Self::Err> {
12710 use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
12711 match s {
12712 "cs-CZ" => Ok(CsMinusCz),
12713 "da-DK" => Ok(DaMinusDk),
12714 "de-AT" => Ok(DeMinusAt),
12715 "de-CH" => Ok(DeMinusCh),
12716 "de-DE" => Ok(DeMinusDe),
12717 "el-GR" => Ok(ElMinusGr),
12718 "en-AT" => Ok(EnMinusAt),
12719 "en-AU" => Ok(EnMinusAu),
12720 "en-BE" => Ok(EnMinusBe),
12721 "en-CA" => Ok(EnMinusCa),
12722 "en-CH" => Ok(EnMinusCh),
12723 "en-CZ" => Ok(EnMinusCz),
12724 "en-DE" => Ok(EnMinusDe),
12725 "en-DK" => Ok(EnMinusDk),
12726 "en-ES" => Ok(EnMinusEs),
12727 "en-FI" => Ok(EnMinusFi),
12728 "en-FR" => Ok(EnMinusFr),
12729 "en-GB" => Ok(EnMinusGb),
12730 "en-GR" => Ok(EnMinusGr),
12731 "en-IE" => Ok(EnMinusIe),
12732 "en-IT" => Ok(EnMinusIt),
12733 "en-NL" => Ok(EnMinusNl),
12734 "en-NO" => Ok(EnMinusNo),
12735 "en-NZ" => Ok(EnMinusNz),
12736 "en-PL" => Ok(EnMinusPl),
12737 "en-PT" => Ok(EnMinusPt),
12738 "en-RO" => Ok(EnMinusRo),
12739 "en-SE" => Ok(EnMinusSe),
12740 "en-US" => Ok(EnMinusUs),
12741 "es-ES" => Ok(EsMinusEs),
12742 "es-US" => Ok(EsMinusUs),
12743 "fi-FI" => Ok(FiMinusFi),
12744 "fr-BE" => Ok(FrMinusBe),
12745 "fr-CA" => Ok(FrMinusCa),
12746 "fr-CH" => Ok(FrMinusCh),
12747 "fr-FR" => Ok(FrMinusFr),
12748 "it-CH" => Ok(ItMinusCh),
12749 "it-IT" => Ok(ItMinusIt),
12750 "nb-NO" => Ok(NbMinusNo),
12751 "nl-BE" => Ok(NlMinusBe),
12752 "nl-NL" => Ok(NlMinusNl),
12753 "pl-PL" => Ok(PlMinusPl),
12754 "pt-PT" => Ok(PtMinusPt),
12755 "ro-RO" => Ok(RoMinusRo),
12756 "sv-FI" => Ok(SvMinusFi),
12757 "sv-SE" => Ok(SvMinusSe),
12758 v => {
12759 tracing::warn!(
12760 "Unknown value '{}' for enum '{}'",
12761 v,
12762 "ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
12763 );
12764 Ok(Unknown(v.to_owned()))
12765 }
12766 }
12767 }
12768}
12769impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12770 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12771 f.write_str(self.as_str())
12772 }
12773}
12774
12775impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12776 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12777 f.write_str(self.as_str())
12778 }
12779}
12780impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12781 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12782 where
12783 S: serde::Serializer,
12784 {
12785 serializer.serialize_str(self.as_str())
12786 }
12787}
12788#[cfg(feature = "deserialize")]
12789impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
12790 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12791 use std::str::FromStr;
12792 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12793 Ok(Self::from_str(&s).expect("infallible"))
12794 }
12795}
12796#[derive(Clone, Debug, serde::Serialize)]
12798pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
12799 pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
12801 #[serde(skip_serializing_if = "Option::is_none")]
12804 pub interval_count: Option<u64>,
12805 #[serde(skip_serializing_if = "Option::is_none")]
12807 pub name: Option<String>,
12808 pub next_billing: SubscriptionNextBillingParam,
12810 pub reference: String,
12813}
12814impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
12815 pub fn new(
12816 interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
12817 next_billing: impl Into<SubscriptionNextBillingParam>,
12818 reference: impl Into<String>,
12819 ) -> Self {
12820 Self {
12821 interval: interval.into(),
12822 interval_count: None,
12823 name: None,
12824 next_billing: next_billing.into(),
12825 reference: reference.into(),
12826 }
12827 }
12828}
12829#[derive(Clone, Eq, PartialEq)]
12831#[non_exhaustive]
12832pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12833 Day,
12834 Month,
12835 Week,
12836 Year,
12837 Unknown(String),
12839}
12840impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12841 pub fn as_str(&self) -> &str {
12842 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
12843 match self {
12844 Day => "day",
12845 Month => "month",
12846 Week => "week",
12847 Year => "year",
12848 Unknown(v) => v,
12849 }
12850 }
12851}
12852
12853impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12854 type Err = std::convert::Infallible;
12855 fn from_str(s: &str) -> Result<Self, Self::Err> {
12856 use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
12857 match s {
12858 "day" => Ok(Day),
12859 "month" => Ok(Month),
12860 "week" => Ok(Week),
12861 "year" => Ok(Year),
12862 v => {
12863 tracing::warn!(
12864 "Unknown value '{}' for enum '{}'",
12865 v,
12866 "ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
12867 );
12868 Ok(Unknown(v.to_owned()))
12869 }
12870 }
12871 }
12872}
12873impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12874 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12875 f.write_str(self.as_str())
12876 }
12877}
12878
12879impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12880 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12881 f.write_str(self.as_str())
12882 }
12883}
12884impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
12885 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12886 where
12887 S: serde::Serializer,
12888 {
12889 serializer.serialize_str(self.as_str())
12890 }
12891}
12892#[cfg(feature = "deserialize")]
12893impl<'de> serde::Deserialize<'de>
12894 for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
12895{
12896 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12897 use std::str::FromStr;
12898 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12899 Ok(Self::from_str(&s).expect("infallible"))
12900 }
12901}
12902#[derive(Clone, Debug, serde::Serialize)]
12904pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12905 #[serde(skip_serializing_if = "Option::is_none")]
12907 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
12908}
12909impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12910 pub fn new() -> Self {
12911 Self { mandate_options: None }
12912 }
12913}
12914impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12915 fn default() -> Self {
12916 Self::new()
12917 }
12918}
12919#[derive(Clone, Debug, serde::Serialize)]
12921pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12922 #[serde(skip_serializing_if = "Option::is_none")]
12927 pub reference_prefix: Option<String>,
12928}
12929impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12930 pub fn new() -> Self {
12931 Self { reference_prefix: None }
12932 }
12933}
12934impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12935 fn default() -> Self {
12936 Self::new()
12937 }
12938}
12939#[derive(Clone, Debug, serde::Serialize)]
12941pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12942 #[serde(skip_serializing_if = "Option::is_none")]
12944 pub financial_connections:
12945 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
12946 #[serde(skip_serializing_if = "Option::is_none")]
12948 pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
12949 #[serde(skip_serializing_if = "Option::is_none")]
12951 pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
12952 #[serde(skip_serializing_if = "Option::is_none")]
12954 pub verification_method:
12955 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
12956}
12957impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12958 pub fn new() -> Self {
12959 Self {
12960 financial_connections: None,
12961 mandate_options: None,
12962 networks: None,
12963 verification_method: None,
12964 }
12965 }
12966}
12967impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12968 fn default() -> Self {
12969 Self::new()
12970 }
12971}
12972#[derive(Clone, Debug, serde::Serialize)]
12974pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12975 #[serde(skip_serializing_if = "Option::is_none")]
12977 pub filters:
12978 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
12979 #[serde(skip_serializing_if = "Option::is_none")]
12983 pub permissions: Option<
12984 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
12985 >,
12986 #[serde(skip_serializing_if = "Option::is_none")]
12988 pub prefetch: Option<
12989 Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
12990 >,
12991 #[serde(skip_serializing_if = "Option::is_none")]
12994 pub return_url: Option<String>,
12995}
12996impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12997 pub fn new() -> Self {
12998 Self { filters: None, permissions: None, prefetch: None, return_url: None }
12999 }
13000}
13001impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
13002 fn default() -> Self {
13003 Self::new()
13004 }
13005}
13006#[derive(Clone, Debug, serde::Serialize)]
13008pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
13009 #[serde(skip_serializing_if = "Option::is_none")]
13012pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
13013
13014}
13015impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
13016 pub fn new() -> Self {
13017 Self { account_subcategories: None }
13018 }
13019}
13020impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
13021 fn default() -> Self {
13022 Self::new()
13023 }
13024}
13025#[derive(Clone, Eq, PartialEq)]
13028#[non_exhaustive]
13029pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
13030{
13031 Checking,
13032 Savings,
13033 Unknown(String),
13035}
13036impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13037 pub fn as_str(&self) -> &str {
13038 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
13039 match self {
13040Checking => "checking",
13041Savings => "savings",
13042Unknown(v) => v,
13043
13044 }
13045 }
13046}
13047
13048impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13049 type Err = std::convert::Infallible;
13050 fn from_str(s: &str) -> Result<Self, Self::Err> {
13051 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
13052 match s {
13053 "checking" => Ok(Checking),
13054"savings" => Ok(Savings),
13055v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
13056
13057 }
13058 }
13059}
13060impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13061 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13062 f.write_str(self.as_str())
13063 }
13064}
13065
13066impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13067 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13068 f.write_str(self.as_str())
13069 }
13070}
13071impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13072 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
13073 serializer.serialize_str(self.as_str())
13074 }
13075}
13076#[cfg(feature = "deserialize")]
13077impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
13078 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13079 use std::str::FromStr;
13080 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13081 Ok(Self::from_str(&s).expect("infallible"))
13082 }
13083}
13084#[derive(Clone, Eq, PartialEq)]
13088#[non_exhaustive]
13089pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
13090 Balances,
13091 Ownership,
13092 PaymentMethod,
13093 Transactions,
13094 Unknown(String),
13096}
13097impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
13098 pub fn as_str(&self) -> &str {
13099 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
13100 match self {
13101 Balances => "balances",
13102 Ownership => "ownership",
13103 PaymentMethod => "payment_method",
13104 Transactions => "transactions",
13105 Unknown(v) => v,
13106 }
13107 }
13108}
13109
13110impl std::str::FromStr
13111 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13112{
13113 type Err = std::convert::Infallible;
13114 fn from_str(s: &str) -> Result<Self, Self::Err> {
13115 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
13116 match s {
13117 "balances" => Ok(Balances),
13118 "ownership" => Ok(Ownership),
13119 "payment_method" => Ok(PaymentMethod),
13120 "transactions" => Ok(Transactions),
13121 v => {
13122 tracing::warn!(
13123 "Unknown value '{}' for enum '{}'",
13124 v,
13125 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
13126 );
13127 Ok(Unknown(v.to_owned()))
13128 }
13129 }
13130 }
13131}
13132impl std::fmt::Display
13133 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13134{
13135 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13136 f.write_str(self.as_str())
13137 }
13138}
13139
13140impl std::fmt::Debug
13141 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13142{
13143 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13144 f.write_str(self.as_str())
13145 }
13146}
13147impl serde::Serialize
13148 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13149{
13150 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13151 where
13152 S: serde::Serializer,
13153 {
13154 serializer.serialize_str(self.as_str())
13155 }
13156}
13157#[cfg(feature = "deserialize")]
13158impl<'de> serde::Deserialize<'de>
13159 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13160{
13161 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13162 use std::str::FromStr;
13163 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13164 Ok(Self::from_str(&s).expect("infallible"))
13165 }
13166}
13167#[derive(Clone, Eq, PartialEq)]
13169#[non_exhaustive]
13170pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
13171 Balances,
13172 Ownership,
13173 Transactions,
13174 Unknown(String),
13176}
13177impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
13178 pub fn as_str(&self) -> &str {
13179 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
13180 match self {
13181 Balances => "balances",
13182 Ownership => "ownership",
13183 Transactions => "transactions",
13184 Unknown(v) => v,
13185 }
13186 }
13187}
13188
13189impl std::str::FromStr
13190 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13191{
13192 type Err = std::convert::Infallible;
13193 fn from_str(s: &str) -> Result<Self, Self::Err> {
13194 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
13195 match s {
13196 "balances" => Ok(Balances),
13197 "ownership" => Ok(Ownership),
13198 "transactions" => Ok(Transactions),
13199 v => {
13200 tracing::warn!(
13201 "Unknown value '{}' for enum '{}'",
13202 v,
13203 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
13204 );
13205 Ok(Unknown(v.to_owned()))
13206 }
13207 }
13208 }
13209}
13210impl std::fmt::Display
13211 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13212{
13213 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13214 f.write_str(self.as_str())
13215 }
13216}
13217
13218impl std::fmt::Debug
13219 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13220{
13221 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13222 f.write_str(self.as_str())
13223 }
13224}
13225impl serde::Serialize
13226 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13227{
13228 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13229 where
13230 S: serde::Serializer,
13231 {
13232 serializer.serialize_str(self.as_str())
13233 }
13234}
13235#[cfg(feature = "deserialize")]
13236impl<'de> serde::Deserialize<'de>
13237 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13238{
13239 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13240 use std::str::FromStr;
13241 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13242 Ok(Self::from_str(&s).expect("infallible"))
13243 }
13244}
13245#[derive(Clone, Debug, serde::Serialize)]
13247pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
13248 #[serde(skip_serializing_if = "Option::is_none")]
13250 pub collection_method:
13251 Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
13252}
13253impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
13254 pub fn new() -> Self {
13255 Self { collection_method: None }
13256 }
13257}
13258impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
13259 fn default() -> Self {
13260 Self::new()
13261 }
13262}
13263#[derive(Clone, Eq, PartialEq)]
13265#[non_exhaustive]
13266pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
13267 Paper,
13268 Unknown(String),
13270}
13271impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
13272 pub fn as_str(&self) -> &str {
13273 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
13274 match self {
13275 Paper => "paper",
13276 Unknown(v) => v,
13277 }
13278 }
13279}
13280
13281impl std::str::FromStr
13282 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
13283{
13284 type Err = std::convert::Infallible;
13285 fn from_str(s: &str) -> Result<Self, Self::Err> {
13286 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
13287 match s {
13288 "paper" => Ok(Paper),
13289 v => {
13290 tracing::warn!(
13291 "Unknown value '{}' for enum '{}'",
13292 v,
13293 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
13294 );
13295 Ok(Unknown(v.to_owned()))
13296 }
13297 }
13298 }
13299}
13300impl std::fmt::Display
13301 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
13302{
13303 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13304 f.write_str(self.as_str())
13305 }
13306}
13307
13308impl std::fmt::Debug
13309 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
13310{
13311 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13312 f.write_str(self.as_str())
13313 }
13314}
13315impl serde::Serialize
13316 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
13317{
13318 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13319 where
13320 S: serde::Serializer,
13321 {
13322 serializer.serialize_str(self.as_str())
13323 }
13324}
13325#[cfg(feature = "deserialize")]
13326impl<'de> serde::Deserialize<'de>
13327 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
13328{
13329 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13330 use std::str::FromStr;
13331 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13332 Ok(Self::from_str(&s).expect("infallible"))
13333 }
13334}
13335#[derive(Clone, Debug, serde::Serialize)]
13337pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
13338 #[serde(skip_serializing_if = "Option::is_none")]
13340 pub requested:
13341 Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
13342}
13343impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
13344 pub fn new() -> Self {
13345 Self { requested: None }
13346 }
13347}
13348impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
13349 fn default() -> Self {
13350 Self::new()
13351 }
13352}
13353#[derive(Clone, Eq, PartialEq)]
13355#[non_exhaustive]
13356pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13357 Ach,
13358 UsDomesticWire,
13359 Unknown(String),
13361}
13362impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13363 pub fn as_str(&self) -> &str {
13364 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
13365 match self {
13366 Ach => "ach",
13367 UsDomesticWire => "us_domestic_wire",
13368 Unknown(v) => v,
13369 }
13370 }
13371}
13372
13373impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13374 type Err = std::convert::Infallible;
13375 fn from_str(s: &str) -> Result<Self, Self::Err> {
13376 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
13377 match s {
13378 "ach" => Ok(Ach),
13379 "us_domestic_wire" => Ok(UsDomesticWire),
13380 v => {
13381 tracing::warn!(
13382 "Unknown value '{}' for enum '{}'",
13383 v,
13384 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
13385 );
13386 Ok(Unknown(v.to_owned()))
13387 }
13388 }
13389 }
13390}
13391impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13392 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13393 f.write_str(self.as_str())
13394 }
13395}
13396
13397impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13398 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13399 f.write_str(self.as_str())
13400 }
13401}
13402impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
13403 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13404 where
13405 S: serde::Serializer,
13406 {
13407 serializer.serialize_str(self.as_str())
13408 }
13409}
13410#[cfg(feature = "deserialize")]
13411impl<'de> serde::Deserialize<'de>
13412 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
13413{
13414 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13415 use std::str::FromStr;
13416 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13417 Ok(Self::from_str(&s).expect("infallible"))
13418 }
13419}
13420#[derive(Clone, Eq, PartialEq)]
13422#[non_exhaustive]
13423pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13424 Automatic,
13425 Instant,
13426 Microdeposits,
13427 Unknown(String),
13429}
13430impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13431 pub fn as_str(&self) -> &str {
13432 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
13433 match self {
13434 Automatic => "automatic",
13435 Instant => "instant",
13436 Microdeposits => "microdeposits",
13437 Unknown(v) => v,
13438 }
13439 }
13440}
13441
13442impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13443 type Err = std::convert::Infallible;
13444 fn from_str(s: &str) -> Result<Self, Self::Err> {
13445 use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
13446 match s {
13447 "automatic" => Ok(Automatic),
13448 "instant" => Ok(Instant),
13449 "microdeposits" => Ok(Microdeposits),
13450 v => {
13451 tracing::warn!(
13452 "Unknown value '{}' for enum '{}'",
13453 v,
13454 "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
13455 );
13456 Ok(Unknown(v.to_owned()))
13457 }
13458 }
13459 }
13460}
13461impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13462 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13463 f.write_str(self.as_str())
13464 }
13465}
13466
13467impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13468 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13469 f.write_str(self.as_str())
13470 }
13471}
13472impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
13473 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13474 where
13475 S: serde::Serializer,
13476 {
13477 serializer.serialize_str(self.as_str())
13478 }
13479}
13480#[cfg(feature = "deserialize")]
13481impl<'de> serde::Deserialize<'de>
13482 for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
13483{
13484 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13485 use std::str::FromStr;
13486 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13487 Ok(Self::from_str(&s).expect("infallible"))
13488 }
13489}
13490#[derive(Clone, Debug, serde::Serialize)]
13505pub struct ConfirmSetupIntent {
13506 inner: ConfirmSetupIntentBuilder,
13507 intent: stripe_shared::SetupIntentId,
13508}
13509impl ConfirmSetupIntent {
13510 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
13512 Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
13513 }
13514 pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
13518 self.inner.confirmation_token = Some(confirmation_token.into());
13519 self
13520 }
13521 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
13523 self.inner.expand = Some(expand.into());
13524 self
13525 }
13526 pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
13527 self.inner.mandate_data = Some(mandate_data.into());
13528 self
13529 }
13530 pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
13532 self.inner.payment_method = Some(payment_method.into());
13533 self
13534 }
13535 pub fn payment_method_data(
13538 mut self,
13539 payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
13540 ) -> Self {
13541 self.inner.payment_method_data = Some(payment_method_data.into());
13542 self
13543 }
13544 pub fn payment_method_options(
13546 mut self,
13547 payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
13548 ) -> Self {
13549 self.inner.payment_method_options = Some(payment_method_options.into());
13550 self
13551 }
13552 pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
13556 self.inner.return_url = Some(return_url.into());
13557 self
13558 }
13559 pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
13561 self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
13562 self
13563 }
13564}
13565impl ConfirmSetupIntent {
13566 pub async fn send<C: StripeClient>(
13568 &self,
13569 client: &C,
13570 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
13571 self.customize().send(client).await
13572 }
13573
13574 pub fn send_blocking<C: StripeBlockingClient>(
13576 &self,
13577 client: &C,
13578 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
13579 self.customize().send_blocking(client)
13580 }
13581}
13582
13583impl StripeRequest for ConfirmSetupIntent {
13584 type Output = stripe_shared::SetupIntent;
13585
13586 fn build(&self) -> RequestBuilder {
13587 let intent = &self.intent;
13588 RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
13589 .form(&self.inner)
13590 }
13591}
13592#[derive(Clone, Debug, serde::Serialize)]
13593struct VerifyMicrodepositsSetupIntentBuilder {
13594 #[serde(skip_serializing_if = "Option::is_none")]
13595 amounts: Option<Vec<i64>>,
13596 #[serde(skip_serializing_if = "Option::is_none")]
13597 descriptor_code: Option<String>,
13598 #[serde(skip_serializing_if = "Option::is_none")]
13599 expand: Option<Vec<String>>,
13600}
13601impl VerifyMicrodepositsSetupIntentBuilder {
13602 fn new() -> Self {
13603 Self { amounts: None, descriptor_code: None, expand: None }
13604 }
13605}
13606#[derive(Clone, Debug, serde::Serialize)]
13608pub struct VerifyMicrodepositsSetupIntent {
13609 inner: VerifyMicrodepositsSetupIntentBuilder,
13610 intent: stripe_shared::SetupIntentId,
13611}
13612impl VerifyMicrodepositsSetupIntent {
13613 pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
13615 Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
13616 }
13617 pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
13619 self.inner.amounts = Some(amounts.into());
13620 self
13621 }
13622 pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
13624 self.inner.descriptor_code = Some(descriptor_code.into());
13625 self
13626 }
13627 pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
13629 self.inner.expand = Some(expand.into());
13630 self
13631 }
13632}
13633impl VerifyMicrodepositsSetupIntent {
13634 pub async fn send<C: StripeClient>(
13636 &self,
13637 client: &C,
13638 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
13639 self.customize().send(client).await
13640 }
13641
13642 pub fn send_blocking<C: StripeBlockingClient>(
13644 &self,
13645 client: &C,
13646 ) -> Result<<Self as StripeRequest>::Output, C::Err> {
13647 self.customize().send_blocking(client)
13648 }
13649}
13650
13651impl StripeRequest for VerifyMicrodepositsSetupIntent {
13652 type Output = stripe_shared::SetupIntent;
13653
13654 fn build(&self) -> RequestBuilder {
13655 let intent = &self.intent;
13656 RequestBuilder::new(
13657 StripeMethod::Post,
13658 format!("/setup_intents/{intent}/verify_microdeposits"),
13659 )
13660 .form(&self.inner)
13661 }
13662}
13663
13664#[derive(Clone, Debug, serde::Serialize)]
13665pub struct OnlineParam {
13666 pub ip_address: String,
13668 pub user_agent: String,
13670}
13671impl OnlineParam {
13672 pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
13673 Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
13674 }
13675}
13676#[derive(Clone, Debug, serde::Serialize)]
13677pub struct PaymentMethodParam {
13678 pub account_number: String,
13680 pub institution_number: String,
13682 pub transit_number: String,
13684}
13685impl PaymentMethodParam {
13686 pub fn new(
13687 account_number: impl Into<String>,
13688 institution_number: impl Into<String>,
13689 transit_number: impl Into<String>,
13690 ) -> Self {
13691 Self {
13692 account_number: account_number.into(),
13693 institution_number: institution_number.into(),
13694 transit_number: transit_number.into(),
13695 }
13696 }
13697}
13698#[derive(Clone, Debug, serde::Serialize)]
13699pub struct BillingDetailsAddress {
13700 #[serde(skip_serializing_if = "Option::is_none")]
13702 pub city: Option<String>,
13703 #[serde(skip_serializing_if = "Option::is_none")]
13705 pub country: Option<String>,
13706 #[serde(skip_serializing_if = "Option::is_none")]
13708 pub line1: Option<String>,
13709 #[serde(skip_serializing_if = "Option::is_none")]
13711 pub line2: Option<String>,
13712 #[serde(skip_serializing_if = "Option::is_none")]
13714 pub postal_code: Option<String>,
13715 #[serde(skip_serializing_if = "Option::is_none")]
13717 pub state: Option<String>,
13718}
13719impl BillingDetailsAddress {
13720 pub fn new() -> Self {
13721 Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
13722 }
13723}
13724impl Default for BillingDetailsAddress {
13725 fn default() -> Self {
13726 Self::new()
13727 }
13728}
13729#[derive(Copy, Clone, Debug, serde::Serialize)]
13730pub struct DateOfBirth {
13731 pub day: i64,
13733 pub month: i64,
13735 pub year: i64,
13737}
13738impl DateOfBirth {
13739 pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
13740 Self { day: day.into(), month: month.into(), year: year.into() }
13741 }
13742}
13743#[derive(Clone, Debug, serde::Serialize)]
13744pub struct RadarOptionsWithHiddenOptions {
13745 #[serde(skip_serializing_if = "Option::is_none")]
13747 pub session: Option<String>,
13748}
13749impl RadarOptionsWithHiddenOptions {
13750 pub fn new() -> Self {
13751 Self { session: None }
13752 }
13753}
13754impl Default for RadarOptionsWithHiddenOptions {
13755 fn default() -> Self {
13756 Self::new()
13757 }
13758}
13759#[derive(Clone, Debug, serde::Serialize)]
13760pub struct PaymentMethodOptionsMandateOptionsParam {
13761 #[serde(skip_serializing_if = "Option::is_none")]
13766 pub reference_prefix: Option<String>,
13767}
13768impl PaymentMethodOptionsMandateOptionsParam {
13769 pub fn new() -> Self {
13770 Self { reference_prefix: None }
13771 }
13772}
13773impl Default for PaymentMethodOptionsMandateOptionsParam {
13774 fn default() -> Self {
13775 Self::new()
13776 }
13777}
13778#[derive(Clone, Debug, serde::Serialize)]
13779pub struct SubscriptionNextBillingParam {
13780 pub amount: i64,
13782 pub date: String,
13784}
13785impl SubscriptionNextBillingParam {
13786 pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
13787 Self { amount: amount.into(), date: date.into() }
13788 }
13789}
13790#[derive(Clone, Debug, serde::Serialize)]
13791pub struct SetupIntentPaymentMethodOptionsParam {
13792 #[serde(skip_serializing_if = "Option::is_none")]
13794 pub persistent_token: Option<String>,
13795}
13796impl SetupIntentPaymentMethodOptionsParam {
13797 pub fn new() -> Self {
13798 Self { persistent_token: None }
13799 }
13800}
13801impl Default for SetupIntentPaymentMethodOptionsParam {
13802 fn default() -> Self {
13803 Self::new()
13804 }
13805}
13806#[derive(Clone, Debug, serde::Serialize)]
13807pub struct PaymentMethodOptionsParam {
13808 #[serde(skip_serializing_if = "Option::is_none")]
13811 pub billing_agreement_id: Option<String>,
13812}
13813impl PaymentMethodOptionsParam {
13814 pub fn new() -> Self {
13815 Self { billing_agreement_id: None }
13816 }
13817}
13818impl Default for PaymentMethodOptionsParam {
13819 fn default() -> Self {
13820 Self::new()
13821 }
13822}
13823#[derive(Clone, Debug, serde::Serialize)]
13824pub struct BillingDetailsInnerParams {
13825 #[serde(skip_serializing_if = "Option::is_none")]
13827 pub address: Option<BillingDetailsAddress>,
13828 #[serde(skip_serializing_if = "Option::is_none")]
13830 pub email: Option<String>,
13831 #[serde(skip_serializing_if = "Option::is_none")]
13833 pub name: Option<String>,
13834 #[serde(skip_serializing_if = "Option::is_none")]
13836 pub phone: Option<String>,
13837 #[serde(skip_serializing_if = "Option::is_none")]
13840 pub tax_id: Option<String>,
13841}
13842impl BillingDetailsInnerParams {
13843 pub fn new() -> Self {
13844 Self { address: None, email: None, name: None, phone: None, tax_id: None }
13845 }
13846}
13847impl Default for BillingDetailsInnerParams {
13848 fn default() -> Self {
13849 Self::new()
13850 }
13851}