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