1use crate::client::{Client, Response};
6use crate::ids::{CustomerId, PaymentMethodId};
7use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp};
8use crate::resources::{
9 Address, BillingDetails, Charge, Customer, PaymentMethodCardPresentNetworks, RadarRadarOptions,
10 SetupAttempt,
11};
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Debug, Default, Deserialize, Serialize)]
18pub struct PaymentMethod {
19 pub id: PaymentMethodId,
21
22 #[serde(skip_serializing_if = "Option::is_none")]
23 pub acss_debit: Option<PaymentMethodAcssDebit>,
24
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub affirm: Option<PaymentMethodAffirm>,
27
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub afterpay_clearpay: Option<PaymentMethodAfterpayClearpay>,
30
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub alipay: Option<PaymentFlowsPrivatePaymentMethodsAlipay>,
33
34 #[serde(skip_serializing_if = "Option::is_none")]
35 pub au_becs_debit: Option<PaymentMethodAuBecsDebit>,
36
37 #[serde(skip_serializing_if = "Option::is_none")]
38 pub bacs_debit: Option<PaymentMethodBacsDebit>,
39
40 #[serde(skip_serializing_if = "Option::is_none")]
41 pub bancontact: Option<PaymentMethodBancontact>,
42
43 pub billing_details: BillingDetails,
44
45 #[serde(skip_serializing_if = "Option::is_none")]
46 pub blik: Option<PaymentMethodBlik>,
47
48 #[serde(skip_serializing_if = "Option::is_none")]
49 pub boleto: Option<PaymentMethodBoleto>,
50
51 #[serde(skip_serializing_if = "Option::is_none")]
52 pub card: Option<CardDetails>,
53
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub card_present: Option<CardPresent>,
56
57 #[serde(skip_serializing_if = "Option::is_none")]
58 pub cashapp: Option<PaymentMethodCashapp>,
59
60 pub created: Timestamp,
64
65 pub customer: Option<Expandable<Customer>>,
69
70 #[serde(skip_serializing_if = "Option::is_none")]
71 pub customer_balance: Option<PaymentMethodCustomerBalance>,
72
73 #[serde(skip_serializing_if = "Option::is_none")]
74 pub eps: Option<PaymentMethodEps>,
75
76 #[serde(skip_serializing_if = "Option::is_none")]
77 pub fpx: Option<PaymentMethodFpx>,
78
79 #[serde(skip_serializing_if = "Option::is_none")]
80 pub giropay: Option<PaymentMethodGiropay>,
81
82 #[serde(skip_serializing_if = "Option::is_none")]
83 pub grabpay: Option<PaymentMethodGrabpay>,
84
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub ideal: Option<PaymentMethodIdeal>,
87
88 #[serde(skip_serializing_if = "Option::is_none")]
89 pub interac_present: Option<PaymentMethodInteracPresent>,
90
91 #[serde(skip_serializing_if = "Option::is_none")]
92 pub klarna: Option<PaymentMethodKlarna>,
93
94 #[serde(skip_serializing_if = "Option::is_none")]
95 pub konbini: Option<PaymentMethodKonbini>,
96
97 #[serde(skip_serializing_if = "Option::is_none")]
98 pub link: Option<PaymentMethodLink>,
99
100 pub livemode: bool,
102
103 pub metadata: Option<Metadata>,
107
108 #[serde(skip_serializing_if = "Option::is_none")]
109 pub oxxo: Option<PaymentMethodOxxo>,
110
111 #[serde(skip_serializing_if = "Option::is_none")]
112 pub p24: Option<PaymentMethodP24>,
113
114 #[serde(skip_serializing_if = "Option::is_none")]
115 pub paynow: Option<PaymentMethodPaynow>,
116
117 #[serde(skip_serializing_if = "Option::is_none")]
118 pub paypal: Option<PaymentMethodPaypal>,
119
120 #[serde(skip_serializing_if = "Option::is_none")]
121 pub pix: Option<PaymentMethodPix>,
122
123 #[serde(skip_serializing_if = "Option::is_none")]
124 pub promptpay: Option<PaymentMethodPromptpay>,
125
126 #[serde(skip_serializing_if = "Option::is_none")]
127 pub radar_options: Option<RadarRadarOptions>,
128
129 #[serde(skip_serializing_if = "Option::is_none")]
130 pub revolut_pay: Option<PaymentMethodRevolutPay>,
131
132 #[serde(skip_serializing_if = "Option::is_none")]
133 pub sepa_debit: Option<PaymentMethodSepaDebit>,
134
135 #[serde(skip_serializing_if = "Option::is_none")]
136 pub sofort: Option<PaymentMethodSofort>,
137
138 #[serde(skip_serializing_if = "Option::is_none")]
139 pub swish: Option<PaymentMethodSwish>,
140
141 #[serde(rename = "type")]
146 pub type_: PaymentMethodType,
147
148 #[serde(skip_serializing_if = "Option::is_none")]
149 pub us_bank_account: Option<PaymentMethodUsBankAccount>,
150
151 #[serde(skip_serializing_if = "Option::is_none")]
152 pub wechat_pay: Option<PaymentMethodWechatPay>,
153
154 #[serde(skip_serializing_if = "Option::is_none")]
155 pub zip: Option<PaymentMethodZip>,
156}
157
158impl PaymentMethod {
159 pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response<List<PaymentMethod>> {
163 client.get_query("/payment_methods", params)
164 }
165
166 pub fn create(client: &Client, params: CreatePaymentMethod<'_>) -> Response<PaymentMethod> {
170 #[allow(clippy::needless_borrows_for_generic_args)]
171 client.post_form("/payment_methods", ¶ms)
172 }
173
174 pub fn retrieve(
178 client: &Client,
179 id: &PaymentMethodId,
180 expand: &[&str],
181 ) -> Response<PaymentMethod> {
182 client.get_query(&format!("/payment_methods/{}", id), Expand { expand })
183 }
184
185 pub fn update(
189 client: &Client,
190 id: &PaymentMethodId,
191 params: UpdatePaymentMethod<'_>,
192 ) -> Response<PaymentMethod> {
193 #[allow(clippy::needless_borrows_for_generic_args)]
194 client.post_form(&format!("/payment_methods/{}", id), ¶ms)
195 }
196}
197
198impl Object for PaymentMethod {
199 type Id = PaymentMethodId;
200 fn id(&self) -> Self::Id {
201 self.id.clone()
202 }
203 fn object(&self) -> &'static str {
204 "payment_method"
205 }
206}
207
208#[derive(Clone, Debug, Default, Deserialize, Serialize)]
209pub struct PaymentFlowsPrivatePaymentMethodsAlipay {}
210
211#[derive(Clone, Debug, Default, Deserialize, Serialize)]
212pub struct PaymentMethodAcssDebit {
213 pub bank_name: Option<String>,
215
216 pub fingerprint: Option<String>,
220
221 pub institution_number: Option<String>,
223
224 pub last4: Option<String>,
226
227 pub transit_number: Option<String>,
229}
230
231#[derive(Clone, Debug, Default, Deserialize, Serialize)]
232pub struct PaymentMethodAffirm {}
233
234#[derive(Clone, Debug, Default, Deserialize, Serialize)]
235pub struct PaymentMethodAfterpayClearpay {}
236
237#[derive(Clone, Debug, Default, Deserialize, Serialize)]
238pub struct PaymentMethodAuBecsDebit {
239 pub bsb_number: Option<String>,
241
242 pub fingerprint: Option<String>,
246
247 pub last4: Option<String>,
249}
250
251#[derive(Clone, Debug, Default, Deserialize, Serialize)]
252pub struct PaymentMethodBacsDebit {
253 pub fingerprint: Option<String>,
257
258 pub last4: Option<String>,
260
261 pub sort_code: Option<String>,
265}
266
267#[derive(Clone, Debug, Default, Deserialize, Serialize)]
268pub struct PaymentMethodBancontact {}
269
270#[derive(Clone, Debug, Default, Deserialize, Serialize)]
271pub struct PaymentMethodBlik {}
272
273#[derive(Clone, Debug, Default, Deserialize, Serialize)]
274pub struct PaymentMethodBoleto {
275 pub tax_id: String,
277}
278
279#[derive(Clone, Debug, Default, Deserialize, Serialize)]
280pub struct CardDetails {
281 pub brand: String,
285
286 pub checks: Option<PaymentMethodCardChecks>,
288
289 pub country: Option<String>,
293
294 #[serde(skip_serializing_if = "Option::is_none")]
298 pub description: Option<String>,
299
300 pub exp_month: i64,
302
303 pub exp_year: i64,
305
306 #[serde(skip_serializing_if = "Option::is_none")]
311 pub fingerprint: Option<String>,
312
313 pub funding: String,
317
318 #[serde(skip_serializing_if = "Option::is_none")]
322 pub iin: Option<String>,
323
324 #[serde(skip_serializing_if = "Option::is_none")]
328 pub issuer: Option<String>,
329
330 pub last4: String,
332
333 pub networks: Option<Networks>,
335
336 pub three_d_secure_usage: Option<ThreeDSecureUsage>,
338
339 pub wallet: Option<WalletDetails>,
341}
342
343#[derive(Clone, Debug, Default, Deserialize, Serialize)]
344pub struct Networks {
345 pub available: Vec<String>,
347
348 pub preferred: Option<String>,
352}
353
354#[derive(Clone, Debug, Default, Deserialize, Serialize)]
355pub struct PaymentMethodCardChecks {
356 pub address_line1_check: Option<String>,
358
359 pub address_postal_code_check: Option<String>,
361
362 pub cvc_check: Option<String>,
364}
365
366#[derive(Clone, Debug, Default, Deserialize, Serialize)]
367pub struct CardPresent {
368 pub brand: Option<String>,
372
373 pub cardholder_name: Option<String>,
379
380 pub country: Option<String>,
384
385 #[serde(skip_serializing_if = "Option::is_none")]
389 pub description: Option<String>,
390
391 pub exp_month: i64,
393
394 pub exp_year: i64,
396
397 pub fingerprint: Option<String>,
402
403 pub funding: Option<String>,
407
408 #[serde(skip_serializing_if = "Option::is_none")]
412 pub iin: Option<String>,
413
414 #[serde(skip_serializing_if = "Option::is_none")]
418 pub issuer: Option<String>,
419
420 pub last4: Option<String>,
422
423 pub networks: Option<PaymentMethodCardPresentNetworks>,
425
426 pub read_method: Option<CardPresentReadMethod>,
428}
429
430#[derive(Clone, Debug, Default, Deserialize, Serialize)]
431pub struct WalletDetails {
432 #[serde(skip_serializing_if = "Option::is_none")]
433 pub amex_express_checkout: Option<WalletAmexExpressCheckout>,
434
435 #[serde(skip_serializing_if = "Option::is_none")]
436 pub apple_pay: Option<WalletApplePay>,
437
438 pub dynamic_last4: Option<String>,
440
441 #[serde(skip_serializing_if = "Option::is_none")]
442 pub google_pay: Option<WalletGooglePay>,
443
444 #[serde(skip_serializing_if = "Option::is_none")]
445 pub link: Option<PaymentMethodCardWalletLink>,
446
447 #[serde(skip_serializing_if = "Option::is_none")]
448 pub masterpass: Option<WalletMasterpass>,
449
450 #[serde(skip_serializing_if = "Option::is_none")]
451 pub samsung_pay: Option<WalletSamsungPay>,
452
453 #[serde(rename = "type")]
458 pub type_: WalletDetailsType,
459
460 #[serde(skip_serializing_if = "Option::is_none")]
461 pub visa_checkout: Option<WalletVisaCheckout>,
462}
463
464#[derive(Clone, Debug, Default, Deserialize, Serialize)]
465pub struct WalletAmexExpressCheckout {}
466
467#[derive(Clone, Debug, Default, Deserialize, Serialize)]
468pub struct WalletApplePay {}
469
470#[derive(Clone, Debug, Default, Deserialize, Serialize)]
471pub struct WalletGooglePay {}
472
473#[derive(Clone, Debug, Default, Deserialize, Serialize)]
474pub struct PaymentMethodCardWalletLink {}
475
476#[derive(Clone, Debug, Default, Deserialize, Serialize)]
477pub struct WalletMasterpass {
478 pub billing_address: Option<Address>,
483
484 pub email: Option<String>,
489
490 pub name: Option<String>,
495
496 pub shipping_address: Option<Address>,
501}
502
503#[derive(Clone, Debug, Default, Deserialize, Serialize)]
504pub struct WalletSamsungPay {}
505
506#[derive(Clone, Debug, Default, Deserialize, Serialize)]
507pub struct WalletVisaCheckout {
508 pub billing_address: Option<Address>,
513
514 pub email: Option<String>,
519
520 pub name: Option<String>,
525
526 pub shipping_address: Option<Address>,
531}
532
533#[derive(Clone, Debug, Default, Deserialize, Serialize)]
534pub struct PaymentMethodCashapp {
535 pub buyer_id: Option<String>,
537
538 pub cashtag: Option<String>,
540}
541
542#[derive(Clone, Debug, Default, Deserialize, Serialize)]
543pub struct PaymentMethodCustomerBalance {}
544
545#[derive(Clone, Debug, Default, Deserialize, Serialize)]
546pub struct PaymentMethodEps {
547 pub bank: Option<PaymentMethodEpsBank>,
551}
552
553#[derive(Clone, Debug, Default, Deserialize, Serialize)]
554pub struct PaymentMethodFpx {
555 pub account_holder_type: Option<PaymentMethodFpxAccountHolderType>,
559
560 pub bank: PaymentMethodFpxBank,
564}
565
566#[derive(Clone, Debug, Default, Deserialize, Serialize)]
567pub struct PaymentMethodGiropay {}
568
569#[derive(Clone, Debug, Default, Deserialize, Serialize)]
570pub struct PaymentMethodGrabpay {}
571
572#[derive(Clone, Debug, Default, Deserialize, Serialize)]
573pub struct PaymentMethodIdeal {
574 pub bank: Option<PaymentMethodIdealBank>,
578
579 pub bic: Option<PaymentMethodIdealBic>,
581}
582
583#[derive(Clone, Debug, Default, Deserialize, Serialize)]
584pub struct PaymentMethodInteracPresent {
585 pub brand: Option<String>,
589
590 pub cardholder_name: Option<String>,
596
597 pub country: Option<String>,
601
602 #[serde(skip_serializing_if = "Option::is_none")]
606 pub description: Option<String>,
607
608 pub exp_month: i64,
610
611 pub exp_year: i64,
613
614 pub fingerprint: Option<String>,
619
620 pub funding: Option<String>,
624
625 #[serde(skip_serializing_if = "Option::is_none")]
629 pub iin: Option<String>,
630
631 #[serde(skip_serializing_if = "Option::is_none")]
635 pub issuer: Option<String>,
636
637 pub last4: Option<String>,
639
640 pub networks: Option<PaymentMethodCardPresentNetworks>,
642
643 pub preferred_locales: Option<Vec<String>>,
647
648 pub read_method: Option<PaymentMethodInteracPresentReadMethod>,
650}
651
652#[derive(Clone, Debug, Default, Deserialize, Serialize)]
653pub struct PaymentMethodKlarna {
654 pub dob: Option<PaymentFlowsPrivatePaymentMethodsKlarnaDob>,
656}
657
658#[derive(Clone, Debug, Default, Deserialize, Serialize)]
659pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob {
660 pub day: Option<i64>,
662
663 pub month: Option<i64>,
665
666 pub year: Option<i64>,
668}
669
670#[derive(Clone, Debug, Default, Deserialize, Serialize)]
671pub struct PaymentMethodKonbini {}
672
673#[derive(Clone, Debug, Default, Deserialize, Serialize)]
674pub struct PaymentMethodLink {
675 pub email: Option<String>,
677
678 #[serde(skip_serializing_if = "Option::is_none")]
680 pub persistent_token: Option<String>,
681}
682
683#[derive(Clone, Debug, Default, Deserialize, Serialize)]
684pub struct PaymentMethodOxxo {}
685
686#[derive(Clone, Debug, Default, Deserialize, Serialize)]
687pub struct PaymentMethodP24 {
688 pub bank: Option<PaymentMethodP24Bank>,
690}
691
692#[derive(Clone, Debug, Default, Deserialize, Serialize)]
693pub struct PaymentMethodPaynow {}
694
695#[derive(Clone, Debug, Default, Deserialize, Serialize)]
696pub struct PaymentMethodPaypal {
697 pub payer_email: Option<String>,
702
703 pub payer_id: Option<String>,
707}
708
709#[derive(Clone, Debug, Default, Deserialize, Serialize)]
710pub struct PaymentMethodPix {}
711
712#[derive(Clone, Debug, Default, Deserialize, Serialize)]
713pub struct PaymentMethodPromptpay {}
714
715#[derive(Clone, Debug, Default, Deserialize, Serialize)]
716pub struct PaymentMethodRevolutPay {}
717
718#[derive(Clone, Debug, Default, Deserialize, Serialize)]
719pub struct PaymentMethodSepaDebit {
720 pub bank_code: Option<String>,
722
723 pub branch_code: Option<String>,
725
726 pub country: Option<String>,
728
729 pub fingerprint: Option<String>,
733
734 pub generated_from: Option<SepaDebitGeneratedFrom>,
736
737 pub last4: Option<String>,
739}
740
741#[derive(Clone, Debug, Default, Deserialize, Serialize)]
742pub struct PaymentMethodSofort {
743 pub country: Option<String>,
745}
746
747#[derive(Clone, Debug, Default, Deserialize, Serialize)]
748pub struct PaymentMethodSwish {}
749
750#[derive(Clone, Debug, Default, Deserialize, Serialize)]
751pub struct PaymentMethodUsBankAccount {
752 pub account_holder_type: Option<PaymentMethodUsBankAccountAccountHolderType>,
754
755 pub account_type: Option<PaymentMethodUsBankAccountAccountType>,
759
760 pub bank_name: Option<String>,
762
763 pub financial_connections_account: Option<String>,
765
766 pub fingerprint: Option<String>,
770
771 pub last4: Option<String>,
773
774 pub networks: Option<UsBankAccountNetworks>,
776
777 pub routing_number: Option<String>,
779
780 pub status_details: Option<PaymentMethodUsBankAccountStatusDetails>,
782}
783
784#[derive(Clone, Debug, Default, Deserialize, Serialize)]
785pub struct PaymentMethodUsBankAccountStatusDetails {
786 #[serde(skip_serializing_if = "Option::is_none")]
787 pub blocked: Option<PaymentMethodUsBankAccountBlocked>,
788}
789
790#[derive(Clone, Debug, Default, Deserialize, Serialize)]
791pub struct PaymentMethodUsBankAccountBlocked {
792 pub network_code: Option<PaymentMethodUsBankAccountBlockedNetworkCode>,
794
795 pub reason: Option<PaymentMethodUsBankAccountBlockedReason>,
797}
798
799#[derive(Clone, Debug, Default, Deserialize, Serialize)]
800pub struct PaymentMethodWechatPay {}
801
802#[derive(Clone, Debug, Default, Deserialize, Serialize)]
803pub struct PaymentMethodZip {}
804
805#[derive(Clone, Debug, Default, Deserialize, Serialize)]
806pub struct SepaDebitGeneratedFrom {
807 pub charge: Option<Expandable<Charge>>,
809
810 pub setup_attempt: Option<Expandable<SetupAttempt>>,
812}
813
814#[derive(Clone, Debug, Default, Deserialize, Serialize)]
815pub struct ThreeDSecureUsage {
816 pub supported: bool,
818}
819
820#[derive(Clone, Debug, Default, Deserialize, Serialize)]
821pub struct UsBankAccountNetworks {
822 pub preferred: Option<String>,
824
825 pub supported: Vec<UsBankAccountNetworksSupported>,
827}
828
829#[derive(Clone, Debug, Serialize, Default)]
831pub struct CreatePaymentMethod<'a> {
832 #[serde(skip_serializing_if = "Option::is_none")]
834 pub acss_debit: Option<CreatePaymentMethodAcssDebit>,
835
836 #[serde(skip_serializing_if = "Option::is_none")]
838 pub affirm: Option<CreatePaymentMethodAffirm>,
839
840 #[serde(skip_serializing_if = "Option::is_none")]
842 pub afterpay_clearpay: Option<CreatePaymentMethodAfterpayClearpay>,
843
844 #[serde(skip_serializing_if = "Option::is_none")]
846 pub alipay: Option<CreatePaymentMethodAlipay>,
847
848 #[serde(skip_serializing_if = "Option::is_none")]
850 pub au_becs_debit: Option<CreatePaymentMethodAuBecsDebit>,
851
852 #[serde(skip_serializing_if = "Option::is_none")]
854 pub bacs_debit: Option<CreatePaymentMethodBacsDebit>,
855
856 #[serde(skip_serializing_if = "Option::is_none")]
858 pub bancontact: Option<CreatePaymentMethodBancontact>,
859
860 #[serde(skip_serializing_if = "Option::is_none")]
862 pub billing_details: Option<BillingDetails>,
863
864 #[serde(skip_serializing_if = "Option::is_none")]
866 pub blik: Option<CreatePaymentMethodBlik>,
867
868 #[serde(skip_serializing_if = "Option::is_none")]
870 pub boleto: Option<CreatePaymentMethodBoleto>,
871
872 #[serde(skip_serializing_if = "Option::is_none")]
878 pub card: Option<CreatePaymentMethodCardUnion>,
879
880 #[serde(skip_serializing_if = "Option::is_none")]
882 pub cashapp: Option<CreatePaymentMethodCashapp>,
883
884 #[serde(skip_serializing_if = "Option::is_none")]
886 pub customer: Option<CustomerId>,
887
888 #[serde(skip_serializing_if = "Option::is_none")]
890 pub customer_balance: Option<CreatePaymentMethodCustomerBalance>,
891
892 #[serde(skip_serializing_if = "Option::is_none")]
894 pub eps: Option<CreatePaymentMethodEps>,
895
896 #[serde(skip_serializing_if = "Expand::is_empty")]
898 pub expand: &'a [&'a str],
899
900 #[serde(skip_serializing_if = "Option::is_none")]
902 pub fpx: Option<CreatePaymentMethodFpx>,
903
904 #[serde(skip_serializing_if = "Option::is_none")]
906 pub giropay: Option<CreatePaymentMethodGiropay>,
907
908 #[serde(skip_serializing_if = "Option::is_none")]
910 pub grabpay: Option<CreatePaymentMethodGrabpay>,
911
912 #[serde(skip_serializing_if = "Option::is_none")]
914 pub ideal: Option<CreatePaymentMethodIdeal>,
915
916 #[serde(skip_serializing_if = "Option::is_none")]
918 pub interac_present: Option<CreatePaymentMethodInteracPresent>,
919
920 #[serde(skip_serializing_if = "Option::is_none")]
922 pub klarna: Option<CreatePaymentMethodKlarna>,
923
924 #[serde(skip_serializing_if = "Option::is_none")]
926 pub konbini: Option<CreatePaymentMethodKonbini>,
927
928 #[serde(skip_serializing_if = "Option::is_none")]
930 pub link: Option<CreatePaymentMethodLink>,
931
932 #[serde(skip_serializing_if = "Option::is_none")]
938 pub metadata: Option<Metadata>,
939
940 #[serde(skip_serializing_if = "Option::is_none")]
942 pub oxxo: Option<CreatePaymentMethodOxxo>,
943
944 #[serde(skip_serializing_if = "Option::is_none")]
946 pub p24: Option<CreatePaymentMethodP24>,
947
948 #[serde(skip_serializing_if = "Option::is_none")]
950 pub payment_method: Option<PaymentMethodId>,
951
952 #[serde(skip_serializing_if = "Option::is_none")]
954 pub paynow: Option<CreatePaymentMethodPaynow>,
955
956 #[serde(skip_serializing_if = "Option::is_none")]
958 pub paypal: Option<CreatePaymentMethodPaypal>,
959
960 #[serde(skip_serializing_if = "Option::is_none")]
962 pub pix: Option<CreatePaymentMethodPix>,
963
964 #[serde(skip_serializing_if = "Option::is_none")]
966 pub promptpay: Option<CreatePaymentMethodPromptpay>,
967
968 #[serde(skip_serializing_if = "Option::is_none")]
972 pub radar_options: Option<CreatePaymentMethodRadarOptions>,
973
974 #[serde(skip_serializing_if = "Option::is_none")]
976 pub revolut_pay: Option<CreatePaymentMethodRevolutPay>,
977
978 #[serde(skip_serializing_if = "Option::is_none")]
980 pub sepa_debit: Option<CreatePaymentMethodSepaDebit>,
981
982 #[serde(skip_serializing_if = "Option::is_none")]
984 pub sofort: Option<CreatePaymentMethodSofort>,
985
986 #[serde(skip_serializing_if = "Option::is_none")]
988 pub swish: Option<CreatePaymentMethodSwish>,
989
990 #[serde(rename = "type")]
995 #[serde(skip_serializing_if = "Option::is_none")]
996 pub type_: Option<PaymentMethodTypeFilter>,
997
998 #[serde(skip_serializing_if = "Option::is_none")]
1000 pub us_bank_account: Option<CreatePaymentMethodUsBankAccount>,
1001
1002 #[serde(skip_serializing_if = "Option::is_none")]
1004 pub wechat_pay: Option<CreatePaymentMethodWechatPay>,
1005
1006 #[serde(skip_serializing_if = "Option::is_none")]
1008 pub zip: Option<CreatePaymentMethodZip>,
1009}
1010
1011impl<'a> CreatePaymentMethod<'a> {
1012 pub fn new() -> Self {
1013 CreatePaymentMethod {
1014 acss_debit: Default::default(),
1015 affirm: Default::default(),
1016 afterpay_clearpay: Default::default(),
1017 alipay: Default::default(),
1018 au_becs_debit: Default::default(),
1019 bacs_debit: Default::default(),
1020 bancontact: Default::default(),
1021 billing_details: Default::default(),
1022 blik: Default::default(),
1023 boleto: Default::default(),
1024 card: Default::default(),
1025 cashapp: Default::default(),
1026 customer: Default::default(),
1027 customer_balance: Default::default(),
1028 eps: Default::default(),
1029 expand: Default::default(),
1030 fpx: Default::default(),
1031 giropay: Default::default(),
1032 grabpay: Default::default(),
1033 ideal: Default::default(),
1034 interac_present: Default::default(),
1035 klarna: Default::default(),
1036 konbini: Default::default(),
1037 link: Default::default(),
1038 metadata: Default::default(),
1039 oxxo: Default::default(),
1040 p24: Default::default(),
1041 payment_method: Default::default(),
1042 paynow: Default::default(),
1043 paypal: Default::default(),
1044 pix: Default::default(),
1045 promptpay: Default::default(),
1046 radar_options: Default::default(),
1047 revolut_pay: Default::default(),
1048 sepa_debit: Default::default(),
1049 sofort: Default::default(),
1050 swish: Default::default(),
1051 type_: Default::default(),
1052 us_bank_account: Default::default(),
1053 wechat_pay: Default::default(),
1054 zip: Default::default(),
1055 }
1056 }
1057}
1058
1059#[derive(Clone, Debug, Serialize, Default)]
1061pub struct ListPaymentMethods<'a> {
1062 #[serde(skip_serializing_if = "Option::is_none")]
1064 pub customer: Option<CustomerId>,
1065
1066 #[serde(skip_serializing_if = "Option::is_none")]
1071 pub ending_before: Option<PaymentMethodId>,
1072
1073 #[serde(skip_serializing_if = "Expand::is_empty")]
1075 pub expand: &'a [&'a str],
1076
1077 #[serde(skip_serializing_if = "Option::is_none")]
1081 pub limit: Option<u64>,
1082
1083 #[serde(skip_serializing_if = "Option::is_none")]
1088 pub starting_after: Option<PaymentMethodId>,
1089
1090 #[serde(rename = "type")]
1095 #[serde(skip_serializing_if = "Option::is_none")]
1096 pub type_: Option<PaymentMethodTypeFilter>,
1097}
1098
1099impl<'a> ListPaymentMethods<'a> {
1100 pub fn new() -> Self {
1101 ListPaymentMethods {
1102 customer: Default::default(),
1103 ending_before: Default::default(),
1104 expand: Default::default(),
1105 limit: Default::default(),
1106 starting_after: Default::default(),
1107 type_: Default::default(),
1108 }
1109 }
1110}
1111impl Paginable for ListPaymentMethods<'_> {
1112 type O = PaymentMethod;
1113 fn set_last(&mut self, item: Self::O) {
1114 self.starting_after = Some(item.id());
1115 }
1116}
1117#[derive(Clone, Debug, Serialize, Default)]
1119pub struct UpdatePaymentMethod<'a> {
1120 #[serde(skip_serializing_if = "Option::is_none")]
1122 pub billing_details: Option<BillingDetails>,
1123
1124 #[serde(skip_serializing_if = "Option::is_none")]
1126 pub card: Option<UpdateApiParam>,
1127
1128 #[serde(skip_serializing_if = "Expand::is_empty")]
1130 pub expand: &'a [&'a str],
1131
1132 #[serde(skip_serializing_if = "Option::is_none")]
1134 pub link: Option<UpdatePaymentMethodLink>,
1135
1136 #[serde(skip_serializing_if = "Option::is_none")]
1142 pub metadata: Option<Metadata>,
1143
1144 #[serde(skip_serializing_if = "Option::is_none")]
1146 pub us_bank_account: Option<UpdatePaymentMethodUsBankAccount>,
1147}
1148
1149impl<'a> UpdatePaymentMethod<'a> {
1150 pub fn new() -> Self {
1151 UpdatePaymentMethod {
1152 billing_details: Default::default(),
1153 card: Default::default(),
1154 expand: Default::default(),
1155 link: Default::default(),
1156 metadata: Default::default(),
1157 us_bank_account: Default::default(),
1158 }
1159 }
1160}
1161
1162#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1163pub struct CreatePaymentMethodAcssDebit {
1164 pub account_number: String,
1166
1167 pub institution_number: String,
1169
1170 pub transit_number: String,
1172}
1173
1174#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1175pub struct CreatePaymentMethodAffirm {}
1176
1177#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1178pub struct CreatePaymentMethodAfterpayClearpay {}
1179
1180#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1181pub struct CreatePaymentMethodAlipay {}
1182
1183#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1184pub struct CreatePaymentMethodAuBecsDebit {
1185 pub account_number: String,
1187
1188 pub bsb_number: String,
1190}
1191
1192#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1193pub struct CreatePaymentMethodBacsDebit {
1194 #[serde(skip_serializing_if = "Option::is_none")]
1196 pub account_number: Option<String>,
1197
1198 #[serde(skip_serializing_if = "Option::is_none")]
1202 pub sort_code: Option<String>,
1203}
1204
1205#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1206pub struct CreatePaymentMethodBancontact {}
1207
1208#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1209pub struct CreatePaymentMethodBlik {}
1210
1211#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1212pub struct CreatePaymentMethodBoleto {
1213 pub tax_id: String,
1215}
1216
1217#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1218pub struct CreatePaymentMethodCashapp {}
1219
1220#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1221pub struct CreatePaymentMethodCustomerBalance {}
1222
1223#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1224pub struct CreatePaymentMethodEps {
1225 #[serde(skip_serializing_if = "Option::is_none")]
1227 pub bank: Option<CreatePaymentMethodEpsBank>,
1228}
1229
1230#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1231pub struct CreatePaymentMethodFpx {
1232 #[serde(skip_serializing_if = "Option::is_none")]
1234 pub account_holder_type: Option<CreatePaymentMethodFpxAccountHolderType>,
1235
1236 pub bank: CreatePaymentMethodFpxBank,
1238}
1239
1240#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1241pub struct CreatePaymentMethodGiropay {}
1242
1243#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1244pub struct CreatePaymentMethodGrabpay {}
1245
1246#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1247pub struct CreatePaymentMethodIdeal {
1248 #[serde(skip_serializing_if = "Option::is_none")]
1250 pub bank: Option<CreatePaymentMethodIdealBank>,
1251}
1252
1253#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1254pub struct CreatePaymentMethodInteracPresent {}
1255
1256#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1257pub struct CreatePaymentMethodKlarna {
1258 #[serde(skip_serializing_if = "Option::is_none")]
1260 pub dob: Option<CreatePaymentMethodKlarnaDob>,
1261}
1262
1263#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1264pub struct CreatePaymentMethodKonbini {}
1265
1266#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1267pub struct CreatePaymentMethodLink {}
1268
1269#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1270pub struct CreatePaymentMethodOxxo {}
1271
1272#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1273pub struct CreatePaymentMethodP24 {
1274 #[serde(skip_serializing_if = "Option::is_none")]
1276 pub bank: Option<CreatePaymentMethodP24Bank>,
1277}
1278
1279#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1280pub struct CreatePaymentMethodPaynow {}
1281
1282#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1283pub struct CreatePaymentMethodPaypal {}
1284
1285#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1286pub struct CreatePaymentMethodPix {}
1287
1288#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1289pub struct CreatePaymentMethodPromptpay {}
1290
1291#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1292pub struct CreatePaymentMethodRadarOptions {
1293 #[serde(skip_serializing_if = "Option::is_none")]
1295 pub session: Option<String>,
1296}
1297
1298#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1299pub struct CreatePaymentMethodRevolutPay {}
1300
1301#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1302pub struct CreatePaymentMethodSepaDebit {
1303 pub iban: String,
1305}
1306
1307#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1308pub struct CreatePaymentMethodSofort {
1309 pub country: CreatePaymentMethodSofortCountry,
1311}
1312
1313#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1314pub struct CreatePaymentMethodSwish {}
1315
1316#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1317pub struct CreatePaymentMethodUsBankAccount {
1318 #[serde(skip_serializing_if = "Option::is_none")]
1320 pub account_holder_type: Option<CreatePaymentMethodUsBankAccountAccountHolderType>,
1321
1322 #[serde(skip_serializing_if = "Option::is_none")]
1324 pub account_number: Option<String>,
1325
1326 #[serde(skip_serializing_if = "Option::is_none")]
1330 pub account_type: Option<CreatePaymentMethodUsBankAccountAccountType>,
1331
1332 #[serde(skip_serializing_if = "Option::is_none")]
1334 pub financial_connections_account: Option<String>,
1335
1336 #[serde(skip_serializing_if = "Option::is_none")]
1338 pub routing_number: Option<String>,
1339}
1340
1341#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1342pub struct CreatePaymentMethodWechatPay {}
1343
1344#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1345pub struct CreatePaymentMethodZip {}
1346
1347#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1348pub struct UpdatePaymentMethodLink {}
1349
1350#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1351pub struct UpdatePaymentMethodUsBankAccount {
1352 #[serde(skip_serializing_if = "Option::is_none")]
1354 pub account_holder_type: Option<UpdatePaymentMethodUsBankAccountAccountHolderType>,
1355
1356 #[serde(skip_serializing_if = "Option::is_none")]
1358 pub account_type: Option<UpdatePaymentMethodUsBankAccountAccountType>,
1359}
1360
1361#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1362pub struct CreatePaymentMethodKlarnaDob {
1363 pub day: i64,
1365
1366 pub month: i64,
1368
1369 pub year: i64,
1371}
1372
1373#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1375#[serde(rename_all = "snake_case")]
1376pub enum CardPresentReadMethod {
1377 ContactEmv,
1378 ContactlessEmv,
1379 ContactlessMagstripeMode,
1380 MagneticStripeFallback,
1381 MagneticStripeTrack2,
1382}
1383
1384impl CardPresentReadMethod {
1385 pub fn as_str(self) -> &'static str {
1386 match self {
1387 CardPresentReadMethod::ContactEmv => "contact_emv",
1388 CardPresentReadMethod::ContactlessEmv => "contactless_emv",
1389 CardPresentReadMethod::ContactlessMagstripeMode => "contactless_magstripe_mode",
1390 CardPresentReadMethod::MagneticStripeFallback => "magnetic_stripe_fallback",
1391 CardPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2",
1392 }
1393 }
1394}
1395
1396impl AsRef<str> for CardPresentReadMethod {
1397 fn as_ref(&self) -> &str {
1398 self.as_str()
1399 }
1400}
1401
1402impl std::fmt::Display for CardPresentReadMethod {
1403 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1404 self.as_str().fmt(f)
1405 }
1406}
1407impl std::default::Default for CardPresentReadMethod {
1408 fn default() -> Self {
1409 Self::ContactEmv
1410 }
1411}
1412
1413#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1415#[serde(rename_all = "snake_case")]
1416pub enum CreatePaymentMethodEpsBank {
1417 ArzteUndApothekerBank,
1418 AustrianAnadiBankAg,
1419 BankAustria,
1420 BankhausCarlSpangler,
1421 BankhausSchelhammerUndSchatteraAg,
1422 BawagPskAg,
1423 BksBankAg,
1424 BrullKallmusBankAg,
1425 BtvVierLanderBank,
1426 CapitalBankGraweGruppeAg,
1427 DeutscheBankAg,
1428 Dolomitenbank,
1429 EasybankAg,
1430 ErsteBankUndSparkassen,
1431 HypoAlpeadriabankInternationalAg,
1432 HypoBankBurgenlandAktiengesellschaft,
1433 HypoNoeLbFurNiederosterreichUWien,
1434 HypoOberosterreichSalzburgSteiermark,
1435 HypoTirolBankAg,
1436 HypoVorarlbergBankAg,
1437 MarchfelderBank,
1438 OberbankAg,
1439 RaiffeisenBankengruppeOsterreich,
1440 SchoellerbankAg,
1441 SpardaBankWien,
1442 VolksbankGruppe,
1443 VolkskreditbankAg,
1444 VrBankBraunau,
1445}
1446
1447impl CreatePaymentMethodEpsBank {
1448 pub fn as_str(self) -> &'static str {
1449 match self {
1450 CreatePaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1451 CreatePaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1452 CreatePaymentMethodEpsBank::BankAustria => "bank_austria",
1453 CreatePaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler",
1454 CreatePaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => {
1455 "bankhaus_schelhammer_und_schattera_ag"
1456 }
1457 CreatePaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag",
1458 CreatePaymentMethodEpsBank::BksBankAg => "bks_bank_ag",
1459 CreatePaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag",
1460 CreatePaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank",
1461 CreatePaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1462 CreatePaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag",
1463 CreatePaymentMethodEpsBank::Dolomitenbank => "dolomitenbank",
1464 CreatePaymentMethodEpsBank::EasybankAg => "easybank_ag",
1465 CreatePaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1466 CreatePaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => {
1467 "hypo_alpeadriabank_international_ag"
1468 }
1469 CreatePaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => {
1470 "hypo_bank_burgenland_aktiengesellschaft"
1471 }
1472 CreatePaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => {
1473 "hypo_noe_lb_fur_niederosterreich_u_wien"
1474 }
1475 CreatePaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => {
1476 "hypo_oberosterreich_salzburg_steiermark"
1477 }
1478 CreatePaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag",
1479 CreatePaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1480 CreatePaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank",
1481 CreatePaymentMethodEpsBank::OberbankAg => "oberbank_ag",
1482 CreatePaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => {
1483 "raiffeisen_bankengruppe_osterreich"
1484 }
1485 CreatePaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag",
1486 CreatePaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien",
1487 CreatePaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe",
1488 CreatePaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag",
1489 CreatePaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau",
1490 }
1491 }
1492}
1493
1494impl AsRef<str> for CreatePaymentMethodEpsBank {
1495 fn as_ref(&self) -> &str {
1496 self.as_str()
1497 }
1498}
1499
1500impl std::fmt::Display for CreatePaymentMethodEpsBank {
1501 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1502 self.as_str().fmt(f)
1503 }
1504}
1505impl std::default::Default for CreatePaymentMethodEpsBank {
1506 fn default() -> Self {
1507 Self::ArzteUndApothekerBank
1508 }
1509}
1510
1511#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1513#[serde(rename_all = "snake_case")]
1514pub enum CreatePaymentMethodFpxAccountHolderType {
1515 Company,
1516 Individual,
1517}
1518
1519impl CreatePaymentMethodFpxAccountHolderType {
1520 pub fn as_str(self) -> &'static str {
1521 match self {
1522 CreatePaymentMethodFpxAccountHolderType::Company => "company",
1523 CreatePaymentMethodFpxAccountHolderType::Individual => "individual",
1524 }
1525 }
1526}
1527
1528impl AsRef<str> for CreatePaymentMethodFpxAccountHolderType {
1529 fn as_ref(&self) -> &str {
1530 self.as_str()
1531 }
1532}
1533
1534impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType {
1535 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1536 self.as_str().fmt(f)
1537 }
1538}
1539impl std::default::Default for CreatePaymentMethodFpxAccountHolderType {
1540 fn default() -> Self {
1541 Self::Company
1542 }
1543}
1544
1545#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1547#[serde(rename_all = "snake_case")]
1548pub enum CreatePaymentMethodFpxBank {
1549 AffinBank,
1550 Agrobank,
1551 AllianceBank,
1552 Ambank,
1553 BankIslam,
1554 BankMuamalat,
1555 BankOfChina,
1556 BankRakyat,
1557 Bsn,
1558 Cimb,
1559 DeutscheBank,
1560 HongLeongBank,
1561 Hsbc,
1562 Kfh,
1563 Maybank2e,
1564 Maybank2u,
1565 Ocbc,
1566 PbEnterprise,
1567 PublicBank,
1568 Rhb,
1569 StandardChartered,
1570 Uob,
1571}
1572
1573impl CreatePaymentMethodFpxBank {
1574 pub fn as_str(self) -> &'static str {
1575 match self {
1576 CreatePaymentMethodFpxBank::AffinBank => "affin_bank",
1577 CreatePaymentMethodFpxBank::Agrobank => "agrobank",
1578 CreatePaymentMethodFpxBank::AllianceBank => "alliance_bank",
1579 CreatePaymentMethodFpxBank::Ambank => "ambank",
1580 CreatePaymentMethodFpxBank::BankIslam => "bank_islam",
1581 CreatePaymentMethodFpxBank::BankMuamalat => "bank_muamalat",
1582 CreatePaymentMethodFpxBank::BankOfChina => "bank_of_china",
1583 CreatePaymentMethodFpxBank::BankRakyat => "bank_rakyat",
1584 CreatePaymentMethodFpxBank::Bsn => "bsn",
1585 CreatePaymentMethodFpxBank::Cimb => "cimb",
1586 CreatePaymentMethodFpxBank::DeutscheBank => "deutsche_bank",
1587 CreatePaymentMethodFpxBank::HongLeongBank => "hong_leong_bank",
1588 CreatePaymentMethodFpxBank::Hsbc => "hsbc",
1589 CreatePaymentMethodFpxBank::Kfh => "kfh",
1590 CreatePaymentMethodFpxBank::Maybank2e => "maybank2e",
1591 CreatePaymentMethodFpxBank::Maybank2u => "maybank2u",
1592 CreatePaymentMethodFpxBank::Ocbc => "ocbc",
1593 CreatePaymentMethodFpxBank::PbEnterprise => "pb_enterprise",
1594 CreatePaymentMethodFpxBank::PublicBank => "public_bank",
1595 CreatePaymentMethodFpxBank::Rhb => "rhb",
1596 CreatePaymentMethodFpxBank::StandardChartered => "standard_chartered",
1597 CreatePaymentMethodFpxBank::Uob => "uob",
1598 }
1599 }
1600}
1601
1602impl AsRef<str> for CreatePaymentMethodFpxBank {
1603 fn as_ref(&self) -> &str {
1604 self.as_str()
1605 }
1606}
1607
1608impl std::fmt::Display for CreatePaymentMethodFpxBank {
1609 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1610 self.as_str().fmt(f)
1611 }
1612}
1613impl std::default::Default for CreatePaymentMethodFpxBank {
1614 fn default() -> Self {
1615 Self::AffinBank
1616 }
1617}
1618
1619#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1621#[serde(rename_all = "snake_case")]
1622pub enum CreatePaymentMethodIdealBank {
1623 AbnAmro,
1624 AsnBank,
1625 Bunq,
1626 Handelsbanken,
1627 Ing,
1628 Knab,
1629 Moneyou,
1630 N26,
1631 Nn,
1632 Rabobank,
1633 Regiobank,
1634 Revolut,
1635 SnsBank,
1636 TriodosBank,
1637 VanLanschot,
1638 Yoursafe,
1639}
1640
1641impl CreatePaymentMethodIdealBank {
1642 pub fn as_str(self) -> &'static str {
1643 match self {
1644 CreatePaymentMethodIdealBank::AbnAmro => "abn_amro",
1645 CreatePaymentMethodIdealBank::AsnBank => "asn_bank",
1646 CreatePaymentMethodIdealBank::Bunq => "bunq",
1647 CreatePaymentMethodIdealBank::Handelsbanken => "handelsbanken",
1648 CreatePaymentMethodIdealBank::Ing => "ing",
1649 CreatePaymentMethodIdealBank::Knab => "knab",
1650 CreatePaymentMethodIdealBank::Moneyou => "moneyou",
1651 CreatePaymentMethodIdealBank::N26 => "n26",
1652 CreatePaymentMethodIdealBank::Nn => "nn",
1653 CreatePaymentMethodIdealBank::Rabobank => "rabobank",
1654 CreatePaymentMethodIdealBank::Regiobank => "regiobank",
1655 CreatePaymentMethodIdealBank::Revolut => "revolut",
1656 CreatePaymentMethodIdealBank::SnsBank => "sns_bank",
1657 CreatePaymentMethodIdealBank::TriodosBank => "triodos_bank",
1658 CreatePaymentMethodIdealBank::VanLanschot => "van_lanschot",
1659 CreatePaymentMethodIdealBank::Yoursafe => "yoursafe",
1660 }
1661 }
1662}
1663
1664impl AsRef<str> for CreatePaymentMethodIdealBank {
1665 fn as_ref(&self) -> &str {
1666 self.as_str()
1667 }
1668}
1669
1670impl std::fmt::Display for CreatePaymentMethodIdealBank {
1671 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1672 self.as_str().fmt(f)
1673 }
1674}
1675impl std::default::Default for CreatePaymentMethodIdealBank {
1676 fn default() -> Self {
1677 Self::AbnAmro
1678 }
1679}
1680
1681#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1683#[serde(rename_all = "snake_case")]
1684pub enum CreatePaymentMethodP24Bank {
1685 AliorBank,
1686 BankMillennium,
1687 BankNowyBfgSa,
1688 BankPekaoSa,
1689 BankiSpbdzielcze,
1690 Blik,
1691 BnpParibas,
1692 Boz,
1693 CitiHandlowy,
1694 CreditAgricole,
1695 Envelobank,
1696 EtransferPocztowy24,
1697 GetinBank,
1698 Ideabank,
1699 Ing,
1700 Inteligo,
1701 MbankMtransfer,
1702 NestPrzelew,
1703 NoblePay,
1704 PbacZIpko,
1705 PlusBank,
1706 SantanderPrzelew24,
1707 TmobileUsbugiBankowe,
1708 ToyotaBank,
1709 Velobank,
1710 VolkswagenBank,
1711}
1712
1713impl CreatePaymentMethodP24Bank {
1714 pub fn as_str(self) -> &'static str {
1715 match self {
1716 CreatePaymentMethodP24Bank::AliorBank => "alior_bank",
1717 CreatePaymentMethodP24Bank::BankMillennium => "bank_millennium",
1718 CreatePaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa",
1719 CreatePaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa",
1720 CreatePaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze",
1721 CreatePaymentMethodP24Bank::Blik => "blik",
1722 CreatePaymentMethodP24Bank::BnpParibas => "bnp_paribas",
1723 CreatePaymentMethodP24Bank::Boz => "boz",
1724 CreatePaymentMethodP24Bank::CitiHandlowy => "citi_handlowy",
1725 CreatePaymentMethodP24Bank::CreditAgricole => "credit_agricole",
1726 CreatePaymentMethodP24Bank::Envelobank => "envelobank",
1727 CreatePaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24",
1728 CreatePaymentMethodP24Bank::GetinBank => "getin_bank",
1729 CreatePaymentMethodP24Bank::Ideabank => "ideabank",
1730 CreatePaymentMethodP24Bank::Ing => "ing",
1731 CreatePaymentMethodP24Bank::Inteligo => "inteligo",
1732 CreatePaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer",
1733 CreatePaymentMethodP24Bank::NestPrzelew => "nest_przelew",
1734 CreatePaymentMethodP24Bank::NoblePay => "noble_pay",
1735 CreatePaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko",
1736 CreatePaymentMethodP24Bank::PlusBank => "plus_bank",
1737 CreatePaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24",
1738 CreatePaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1739 CreatePaymentMethodP24Bank::ToyotaBank => "toyota_bank",
1740 CreatePaymentMethodP24Bank::Velobank => "velobank",
1741 CreatePaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank",
1742 }
1743 }
1744}
1745
1746impl AsRef<str> for CreatePaymentMethodP24Bank {
1747 fn as_ref(&self) -> &str {
1748 self.as_str()
1749 }
1750}
1751
1752impl std::fmt::Display for CreatePaymentMethodP24Bank {
1753 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1754 self.as_str().fmt(f)
1755 }
1756}
1757impl std::default::Default for CreatePaymentMethodP24Bank {
1758 fn default() -> Self {
1759 Self::AliorBank
1760 }
1761}
1762
1763#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1765#[serde(rename_all = "snake_case")]
1766pub enum CreatePaymentMethodSofortCountry {
1767 #[serde(rename = "AT")]
1768 At,
1769 #[serde(rename = "BE")]
1770 Be,
1771 #[serde(rename = "DE")]
1772 De,
1773 #[serde(rename = "ES")]
1774 Es,
1775 #[serde(rename = "IT")]
1776 It,
1777 #[serde(rename = "NL")]
1778 Nl,
1779}
1780
1781impl CreatePaymentMethodSofortCountry {
1782 pub fn as_str(self) -> &'static str {
1783 match self {
1784 CreatePaymentMethodSofortCountry::At => "AT",
1785 CreatePaymentMethodSofortCountry::Be => "BE",
1786 CreatePaymentMethodSofortCountry::De => "DE",
1787 CreatePaymentMethodSofortCountry::Es => "ES",
1788 CreatePaymentMethodSofortCountry::It => "IT",
1789 CreatePaymentMethodSofortCountry::Nl => "NL",
1790 }
1791 }
1792}
1793
1794impl AsRef<str> for CreatePaymentMethodSofortCountry {
1795 fn as_ref(&self) -> &str {
1796 self.as_str()
1797 }
1798}
1799
1800impl std::fmt::Display for CreatePaymentMethodSofortCountry {
1801 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1802 self.as_str().fmt(f)
1803 }
1804}
1805impl std::default::Default for CreatePaymentMethodSofortCountry {
1806 fn default() -> Self {
1807 Self::At
1808 }
1809}
1810
1811#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1813#[serde(rename_all = "snake_case")]
1814pub enum CreatePaymentMethodUsBankAccountAccountHolderType {
1815 Company,
1816 Individual,
1817}
1818
1819impl CreatePaymentMethodUsBankAccountAccountHolderType {
1820 pub fn as_str(self) -> &'static str {
1821 match self {
1822 CreatePaymentMethodUsBankAccountAccountHolderType::Company => "company",
1823 CreatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
1824 }
1825 }
1826}
1827
1828impl AsRef<str> for CreatePaymentMethodUsBankAccountAccountHolderType {
1829 fn as_ref(&self) -> &str {
1830 self.as_str()
1831 }
1832}
1833
1834impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType {
1835 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1836 self.as_str().fmt(f)
1837 }
1838}
1839impl std::default::Default for CreatePaymentMethodUsBankAccountAccountHolderType {
1840 fn default() -> Self {
1841 Self::Company
1842 }
1843}
1844
1845#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1847#[serde(rename_all = "snake_case")]
1848pub enum CreatePaymentMethodUsBankAccountAccountType {
1849 Checking,
1850 Savings,
1851}
1852
1853impl CreatePaymentMethodUsBankAccountAccountType {
1854 pub fn as_str(self) -> &'static str {
1855 match self {
1856 CreatePaymentMethodUsBankAccountAccountType::Checking => "checking",
1857 CreatePaymentMethodUsBankAccountAccountType::Savings => "savings",
1858 }
1859 }
1860}
1861
1862impl AsRef<str> for CreatePaymentMethodUsBankAccountAccountType {
1863 fn as_ref(&self) -> &str {
1864 self.as_str()
1865 }
1866}
1867
1868impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType {
1869 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1870 self.as_str().fmt(f)
1871 }
1872}
1873impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType {
1874 fn default() -> Self {
1875 Self::Checking
1876 }
1877}
1878
1879#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1881#[serde(rename_all = "snake_case")]
1882pub enum PaymentMethodEpsBank {
1883 ArzteUndApothekerBank,
1884 AustrianAnadiBankAg,
1885 BankAustria,
1886 BankhausCarlSpangler,
1887 BankhausSchelhammerUndSchatteraAg,
1888 BawagPskAg,
1889 BksBankAg,
1890 BrullKallmusBankAg,
1891 BtvVierLanderBank,
1892 CapitalBankGraweGruppeAg,
1893 DeutscheBankAg,
1894 Dolomitenbank,
1895 EasybankAg,
1896 ErsteBankUndSparkassen,
1897 HypoAlpeadriabankInternationalAg,
1898 HypoBankBurgenlandAktiengesellschaft,
1899 HypoNoeLbFurNiederosterreichUWien,
1900 HypoOberosterreichSalzburgSteiermark,
1901 HypoTirolBankAg,
1902 HypoVorarlbergBankAg,
1903 MarchfelderBank,
1904 OberbankAg,
1905 RaiffeisenBankengruppeOsterreich,
1906 SchoellerbankAg,
1907 SpardaBankWien,
1908 VolksbankGruppe,
1909 VolkskreditbankAg,
1910 VrBankBraunau,
1911}
1912
1913impl PaymentMethodEpsBank {
1914 pub fn as_str(self) -> &'static str {
1915 match self {
1916 PaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1917 PaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1918 PaymentMethodEpsBank::BankAustria => "bank_austria",
1919 PaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler",
1920 PaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => {
1921 "bankhaus_schelhammer_und_schattera_ag"
1922 }
1923 PaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag",
1924 PaymentMethodEpsBank::BksBankAg => "bks_bank_ag",
1925 PaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag",
1926 PaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank",
1927 PaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1928 PaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag",
1929 PaymentMethodEpsBank::Dolomitenbank => "dolomitenbank",
1930 PaymentMethodEpsBank::EasybankAg => "easybank_ag",
1931 PaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1932 PaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => {
1933 "hypo_alpeadriabank_international_ag"
1934 }
1935 PaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => {
1936 "hypo_bank_burgenland_aktiengesellschaft"
1937 }
1938 PaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => {
1939 "hypo_noe_lb_fur_niederosterreich_u_wien"
1940 }
1941 PaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => {
1942 "hypo_oberosterreich_salzburg_steiermark"
1943 }
1944 PaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag",
1945 PaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1946 PaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank",
1947 PaymentMethodEpsBank::OberbankAg => "oberbank_ag",
1948 PaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => {
1949 "raiffeisen_bankengruppe_osterreich"
1950 }
1951 PaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag",
1952 PaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien",
1953 PaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe",
1954 PaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag",
1955 PaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau",
1956 }
1957 }
1958}
1959
1960impl AsRef<str> for PaymentMethodEpsBank {
1961 fn as_ref(&self) -> &str {
1962 self.as_str()
1963 }
1964}
1965
1966impl std::fmt::Display for PaymentMethodEpsBank {
1967 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1968 self.as_str().fmt(f)
1969 }
1970}
1971impl std::default::Default for PaymentMethodEpsBank {
1972 fn default() -> Self {
1973 Self::ArzteUndApothekerBank
1974 }
1975}
1976
1977#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1979#[serde(rename_all = "snake_case")]
1980pub enum PaymentMethodFpxAccountHolderType {
1981 Company,
1982 Individual,
1983}
1984
1985impl PaymentMethodFpxAccountHolderType {
1986 pub fn as_str(self) -> &'static str {
1987 match self {
1988 PaymentMethodFpxAccountHolderType::Company => "company",
1989 PaymentMethodFpxAccountHolderType::Individual => "individual",
1990 }
1991 }
1992}
1993
1994impl AsRef<str> for PaymentMethodFpxAccountHolderType {
1995 fn as_ref(&self) -> &str {
1996 self.as_str()
1997 }
1998}
1999
2000impl std::fmt::Display for PaymentMethodFpxAccountHolderType {
2001 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2002 self.as_str().fmt(f)
2003 }
2004}
2005impl std::default::Default for PaymentMethodFpxAccountHolderType {
2006 fn default() -> Self {
2007 Self::Company
2008 }
2009}
2010
2011#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2013#[serde(rename_all = "snake_case")]
2014pub enum PaymentMethodFpxBank {
2015 AffinBank,
2016 Agrobank,
2017 AllianceBank,
2018 Ambank,
2019 BankIslam,
2020 BankMuamalat,
2021 BankOfChina,
2022 BankRakyat,
2023 Bsn,
2024 Cimb,
2025 DeutscheBank,
2026 HongLeongBank,
2027 Hsbc,
2028 Kfh,
2029 Maybank2e,
2030 Maybank2u,
2031 Ocbc,
2032 PbEnterprise,
2033 PublicBank,
2034 Rhb,
2035 StandardChartered,
2036 Uob,
2037}
2038
2039impl PaymentMethodFpxBank {
2040 pub fn as_str(self) -> &'static str {
2041 match self {
2042 PaymentMethodFpxBank::AffinBank => "affin_bank",
2043 PaymentMethodFpxBank::Agrobank => "agrobank",
2044 PaymentMethodFpxBank::AllianceBank => "alliance_bank",
2045 PaymentMethodFpxBank::Ambank => "ambank",
2046 PaymentMethodFpxBank::BankIslam => "bank_islam",
2047 PaymentMethodFpxBank::BankMuamalat => "bank_muamalat",
2048 PaymentMethodFpxBank::BankOfChina => "bank_of_china",
2049 PaymentMethodFpxBank::BankRakyat => "bank_rakyat",
2050 PaymentMethodFpxBank::Bsn => "bsn",
2051 PaymentMethodFpxBank::Cimb => "cimb",
2052 PaymentMethodFpxBank::DeutscheBank => "deutsche_bank",
2053 PaymentMethodFpxBank::HongLeongBank => "hong_leong_bank",
2054 PaymentMethodFpxBank::Hsbc => "hsbc",
2055 PaymentMethodFpxBank::Kfh => "kfh",
2056 PaymentMethodFpxBank::Maybank2e => "maybank2e",
2057 PaymentMethodFpxBank::Maybank2u => "maybank2u",
2058 PaymentMethodFpxBank::Ocbc => "ocbc",
2059 PaymentMethodFpxBank::PbEnterprise => "pb_enterprise",
2060 PaymentMethodFpxBank::PublicBank => "public_bank",
2061 PaymentMethodFpxBank::Rhb => "rhb",
2062 PaymentMethodFpxBank::StandardChartered => "standard_chartered",
2063 PaymentMethodFpxBank::Uob => "uob",
2064 }
2065 }
2066}
2067
2068impl AsRef<str> for PaymentMethodFpxBank {
2069 fn as_ref(&self) -> &str {
2070 self.as_str()
2071 }
2072}
2073
2074impl std::fmt::Display for PaymentMethodFpxBank {
2075 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2076 self.as_str().fmt(f)
2077 }
2078}
2079impl std::default::Default for PaymentMethodFpxBank {
2080 fn default() -> Self {
2081 Self::AffinBank
2082 }
2083}
2084
2085#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2087#[serde(rename_all = "snake_case")]
2088pub enum PaymentMethodIdealBank {
2089 AbnAmro,
2090 AsnBank,
2091 Bunq,
2092 Handelsbanken,
2093 Ing,
2094 Knab,
2095 Moneyou,
2096 N26,
2097 Nn,
2098 Rabobank,
2099 Regiobank,
2100 Revolut,
2101 SnsBank,
2102 TriodosBank,
2103 VanLanschot,
2104 Yoursafe,
2105}
2106
2107impl PaymentMethodIdealBank {
2108 pub fn as_str(self) -> &'static str {
2109 match self {
2110 PaymentMethodIdealBank::AbnAmro => "abn_amro",
2111 PaymentMethodIdealBank::AsnBank => "asn_bank",
2112 PaymentMethodIdealBank::Bunq => "bunq",
2113 PaymentMethodIdealBank::Handelsbanken => "handelsbanken",
2114 PaymentMethodIdealBank::Ing => "ing",
2115 PaymentMethodIdealBank::Knab => "knab",
2116 PaymentMethodIdealBank::Moneyou => "moneyou",
2117 PaymentMethodIdealBank::N26 => "n26",
2118 PaymentMethodIdealBank::Nn => "nn",
2119 PaymentMethodIdealBank::Rabobank => "rabobank",
2120 PaymentMethodIdealBank::Regiobank => "regiobank",
2121 PaymentMethodIdealBank::Revolut => "revolut",
2122 PaymentMethodIdealBank::SnsBank => "sns_bank",
2123 PaymentMethodIdealBank::TriodosBank => "triodos_bank",
2124 PaymentMethodIdealBank::VanLanschot => "van_lanschot",
2125 PaymentMethodIdealBank::Yoursafe => "yoursafe",
2126 }
2127 }
2128}
2129
2130impl AsRef<str> for PaymentMethodIdealBank {
2131 fn as_ref(&self) -> &str {
2132 self.as_str()
2133 }
2134}
2135
2136impl std::fmt::Display for PaymentMethodIdealBank {
2137 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2138 self.as_str().fmt(f)
2139 }
2140}
2141impl std::default::Default for PaymentMethodIdealBank {
2142 fn default() -> Self {
2143 Self::AbnAmro
2144 }
2145}
2146
2147#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2149#[serde(rename_all = "snake_case")]
2150pub enum PaymentMethodIdealBic {
2151 #[serde(rename = "ABNANL2A")]
2152 Abnanl2a,
2153 #[serde(rename = "ASNBNL21")]
2154 Asnbnl21,
2155 #[serde(rename = "BITSNL2A")]
2156 Bitsnl2a,
2157 #[serde(rename = "BUNQNL2A")]
2158 Bunqnl2a,
2159 #[serde(rename = "FVLBNL22")]
2160 Fvlbnl22,
2161 #[serde(rename = "HANDNL2A")]
2162 Handnl2a,
2163 #[serde(rename = "INGBNL2A")]
2164 Ingbnl2a,
2165 #[serde(rename = "KNABNL2H")]
2166 Knabnl2h,
2167 #[serde(rename = "MOYONL21")]
2168 Moyonl21,
2169 #[serde(rename = "NNBANL2G")]
2170 Nnbanl2g,
2171 #[serde(rename = "NTSBDEB1")]
2172 Ntsbdeb1,
2173 #[serde(rename = "RABONL2U")]
2174 Rabonl2u,
2175 #[serde(rename = "RBRBNL21")]
2176 Rbrbnl21,
2177 #[serde(rename = "REVOIE23")]
2178 Revoie23,
2179 #[serde(rename = "REVOLT21")]
2180 Revolt21,
2181 #[serde(rename = "SNSBNL2A")]
2182 Snsbnl2a,
2183 #[serde(rename = "TRIONL2U")]
2184 Trionl2u,
2185}
2186
2187impl PaymentMethodIdealBic {
2188 pub fn as_str(self) -> &'static str {
2189 match self {
2190 PaymentMethodIdealBic::Abnanl2a => "ABNANL2A",
2191 PaymentMethodIdealBic::Asnbnl21 => "ASNBNL21",
2192 PaymentMethodIdealBic::Bitsnl2a => "BITSNL2A",
2193 PaymentMethodIdealBic::Bunqnl2a => "BUNQNL2A",
2194 PaymentMethodIdealBic::Fvlbnl22 => "FVLBNL22",
2195 PaymentMethodIdealBic::Handnl2a => "HANDNL2A",
2196 PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A",
2197 PaymentMethodIdealBic::Knabnl2h => "KNABNL2H",
2198 PaymentMethodIdealBic::Moyonl21 => "MOYONL21",
2199 PaymentMethodIdealBic::Nnbanl2g => "NNBANL2G",
2200 PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1",
2201 PaymentMethodIdealBic::Rabonl2u => "RABONL2U",
2202 PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21",
2203 PaymentMethodIdealBic::Revoie23 => "REVOIE23",
2204 PaymentMethodIdealBic::Revolt21 => "REVOLT21",
2205 PaymentMethodIdealBic::Snsbnl2a => "SNSBNL2A",
2206 PaymentMethodIdealBic::Trionl2u => "TRIONL2U",
2207 }
2208 }
2209}
2210
2211impl AsRef<str> for PaymentMethodIdealBic {
2212 fn as_ref(&self) -> &str {
2213 self.as_str()
2214 }
2215}
2216
2217impl std::fmt::Display for PaymentMethodIdealBic {
2218 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2219 self.as_str().fmt(f)
2220 }
2221}
2222impl std::default::Default for PaymentMethodIdealBic {
2223 fn default() -> Self {
2224 Self::Abnanl2a
2225 }
2226}
2227
2228#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2230#[serde(rename_all = "snake_case")]
2231pub enum PaymentMethodInteracPresentReadMethod {
2232 ContactEmv,
2233 ContactlessEmv,
2234 ContactlessMagstripeMode,
2235 MagneticStripeFallback,
2236 MagneticStripeTrack2,
2237}
2238
2239impl PaymentMethodInteracPresentReadMethod {
2240 pub fn as_str(self) -> &'static str {
2241 match self {
2242 PaymentMethodInteracPresentReadMethod::ContactEmv => "contact_emv",
2243 PaymentMethodInteracPresentReadMethod::ContactlessEmv => "contactless_emv",
2244 PaymentMethodInteracPresentReadMethod::ContactlessMagstripeMode => {
2245 "contactless_magstripe_mode"
2246 }
2247 PaymentMethodInteracPresentReadMethod::MagneticStripeFallback => {
2248 "magnetic_stripe_fallback"
2249 }
2250 PaymentMethodInteracPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2",
2251 }
2252 }
2253}
2254
2255impl AsRef<str> for PaymentMethodInteracPresentReadMethod {
2256 fn as_ref(&self) -> &str {
2257 self.as_str()
2258 }
2259}
2260
2261impl std::fmt::Display for PaymentMethodInteracPresentReadMethod {
2262 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2263 self.as_str().fmt(f)
2264 }
2265}
2266impl std::default::Default for PaymentMethodInteracPresentReadMethod {
2267 fn default() -> Self {
2268 Self::ContactEmv
2269 }
2270}
2271
2272#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2274#[serde(rename_all = "snake_case")]
2275pub enum PaymentMethodP24Bank {
2276 AliorBank,
2277 BankMillennium,
2278 BankNowyBfgSa,
2279 BankPekaoSa,
2280 BankiSpbdzielcze,
2281 Blik,
2282 BnpParibas,
2283 Boz,
2284 CitiHandlowy,
2285 CreditAgricole,
2286 Envelobank,
2287 EtransferPocztowy24,
2288 GetinBank,
2289 Ideabank,
2290 Ing,
2291 Inteligo,
2292 MbankMtransfer,
2293 NestPrzelew,
2294 NoblePay,
2295 PbacZIpko,
2296 PlusBank,
2297 SantanderPrzelew24,
2298 TmobileUsbugiBankowe,
2299 ToyotaBank,
2300 Velobank,
2301 VolkswagenBank,
2302}
2303
2304impl PaymentMethodP24Bank {
2305 pub fn as_str(self) -> &'static str {
2306 match self {
2307 PaymentMethodP24Bank::AliorBank => "alior_bank",
2308 PaymentMethodP24Bank::BankMillennium => "bank_millennium",
2309 PaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa",
2310 PaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa",
2311 PaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze",
2312 PaymentMethodP24Bank::Blik => "blik",
2313 PaymentMethodP24Bank::BnpParibas => "bnp_paribas",
2314 PaymentMethodP24Bank::Boz => "boz",
2315 PaymentMethodP24Bank::CitiHandlowy => "citi_handlowy",
2316 PaymentMethodP24Bank::CreditAgricole => "credit_agricole",
2317 PaymentMethodP24Bank::Envelobank => "envelobank",
2318 PaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24",
2319 PaymentMethodP24Bank::GetinBank => "getin_bank",
2320 PaymentMethodP24Bank::Ideabank => "ideabank",
2321 PaymentMethodP24Bank::Ing => "ing",
2322 PaymentMethodP24Bank::Inteligo => "inteligo",
2323 PaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer",
2324 PaymentMethodP24Bank::NestPrzelew => "nest_przelew",
2325 PaymentMethodP24Bank::NoblePay => "noble_pay",
2326 PaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko",
2327 PaymentMethodP24Bank::PlusBank => "plus_bank",
2328 PaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24",
2329 PaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
2330 PaymentMethodP24Bank::ToyotaBank => "toyota_bank",
2331 PaymentMethodP24Bank::Velobank => "velobank",
2332 PaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank",
2333 }
2334 }
2335}
2336
2337impl AsRef<str> for PaymentMethodP24Bank {
2338 fn as_ref(&self) -> &str {
2339 self.as_str()
2340 }
2341}
2342
2343impl std::fmt::Display for PaymentMethodP24Bank {
2344 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2345 self.as_str().fmt(f)
2346 }
2347}
2348impl std::default::Default for PaymentMethodP24Bank {
2349 fn default() -> Self {
2350 Self::AliorBank
2351 }
2352}
2353
2354#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2356#[serde(rename_all = "snake_case")]
2357pub enum PaymentMethodType {
2358 AcssDebit,
2359 Affirm,
2360 AfterpayClearpay,
2361 Alipay,
2362 AuBecsDebit,
2363 BacsDebit,
2364 Bancontact,
2365 Blik,
2366 Boleto,
2367 Card,
2368 CardPresent,
2369 Cashapp,
2370 CustomerBalance,
2371 Eps,
2372 Fpx,
2373 Giropay,
2374 Grabpay,
2375 Ideal,
2376 InteracPresent,
2377 Klarna,
2378 Konbini,
2379 Link,
2380 Oxxo,
2381 P24,
2382 Paynow,
2383 Paypal,
2384 Pix,
2385 Promptpay,
2386 RevolutPay,
2387 SepaDebit,
2388 Sofort,
2389 Swish,
2390 UsBankAccount,
2391 WechatPay,
2392 Zip,
2393}
2394
2395impl PaymentMethodType {
2396 pub fn as_str(self) -> &'static str {
2397 match self {
2398 PaymentMethodType::AcssDebit => "acss_debit",
2399 PaymentMethodType::Affirm => "affirm",
2400 PaymentMethodType::AfterpayClearpay => "afterpay_clearpay",
2401 PaymentMethodType::Alipay => "alipay",
2402 PaymentMethodType::AuBecsDebit => "au_becs_debit",
2403 PaymentMethodType::BacsDebit => "bacs_debit",
2404 PaymentMethodType::Bancontact => "bancontact",
2405 PaymentMethodType::Blik => "blik",
2406 PaymentMethodType::Boleto => "boleto",
2407 PaymentMethodType::Card => "card",
2408 PaymentMethodType::CardPresent => "card_present",
2409 PaymentMethodType::Cashapp => "cashapp",
2410 PaymentMethodType::CustomerBalance => "customer_balance",
2411 PaymentMethodType::Eps => "eps",
2412 PaymentMethodType::Fpx => "fpx",
2413 PaymentMethodType::Giropay => "giropay",
2414 PaymentMethodType::Grabpay => "grabpay",
2415 PaymentMethodType::Ideal => "ideal",
2416 PaymentMethodType::InteracPresent => "interac_present",
2417 PaymentMethodType::Klarna => "klarna",
2418 PaymentMethodType::Konbini => "konbini",
2419 PaymentMethodType::Link => "link",
2420 PaymentMethodType::Oxxo => "oxxo",
2421 PaymentMethodType::P24 => "p24",
2422 PaymentMethodType::Paynow => "paynow",
2423 PaymentMethodType::Paypal => "paypal",
2424 PaymentMethodType::Pix => "pix",
2425 PaymentMethodType::Promptpay => "promptpay",
2426 PaymentMethodType::RevolutPay => "revolut_pay",
2427 PaymentMethodType::SepaDebit => "sepa_debit",
2428 PaymentMethodType::Sofort => "sofort",
2429 PaymentMethodType::Swish => "swish",
2430 PaymentMethodType::UsBankAccount => "us_bank_account",
2431 PaymentMethodType::WechatPay => "wechat_pay",
2432 PaymentMethodType::Zip => "zip",
2433 }
2434 }
2435}
2436
2437impl AsRef<str> for PaymentMethodType {
2438 fn as_ref(&self) -> &str {
2439 self.as_str()
2440 }
2441}
2442
2443impl std::fmt::Display for PaymentMethodType {
2444 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2445 self.as_str().fmt(f)
2446 }
2447}
2448impl std::default::Default for PaymentMethodType {
2449 fn default() -> Self {
2450 Self::AcssDebit
2451 }
2452}
2453
2454#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2456#[serde(rename_all = "snake_case")]
2457pub enum PaymentMethodTypeFilter {
2458 AcssDebit,
2459 Affirm,
2460 AfterpayClearpay,
2461 Alipay,
2462 AuBecsDebit,
2463 BacsDebit,
2464 Bancontact,
2465 Blik,
2466 Boleto,
2467 Card,
2468 Cashapp,
2469 CustomerBalance,
2470 Eps,
2471 Fpx,
2472 Giropay,
2473 Grabpay,
2474 Ideal,
2475 Klarna,
2476 Konbini,
2477 Link,
2478 Oxxo,
2479 P24,
2480 Paynow,
2481 Paypal,
2482 Pix,
2483 Promptpay,
2484 RevolutPay,
2485 SepaDebit,
2486 Sofort,
2487 Swish,
2488 UsBankAccount,
2489 WechatPay,
2490 Zip,
2491}
2492
2493impl PaymentMethodTypeFilter {
2494 pub fn as_str(self) -> &'static str {
2495 match self {
2496 PaymentMethodTypeFilter::AcssDebit => "acss_debit",
2497 PaymentMethodTypeFilter::Affirm => "affirm",
2498 PaymentMethodTypeFilter::AfterpayClearpay => "afterpay_clearpay",
2499 PaymentMethodTypeFilter::Alipay => "alipay",
2500 PaymentMethodTypeFilter::AuBecsDebit => "au_becs_debit",
2501 PaymentMethodTypeFilter::BacsDebit => "bacs_debit",
2502 PaymentMethodTypeFilter::Bancontact => "bancontact",
2503 PaymentMethodTypeFilter::Blik => "blik",
2504 PaymentMethodTypeFilter::Boleto => "boleto",
2505 PaymentMethodTypeFilter::Card => "card",
2506 PaymentMethodTypeFilter::Cashapp => "cashapp",
2507 PaymentMethodTypeFilter::CustomerBalance => "customer_balance",
2508 PaymentMethodTypeFilter::Eps => "eps",
2509 PaymentMethodTypeFilter::Fpx => "fpx",
2510 PaymentMethodTypeFilter::Giropay => "giropay",
2511 PaymentMethodTypeFilter::Grabpay => "grabpay",
2512 PaymentMethodTypeFilter::Ideal => "ideal",
2513 PaymentMethodTypeFilter::Klarna => "klarna",
2514 PaymentMethodTypeFilter::Konbini => "konbini",
2515 PaymentMethodTypeFilter::Link => "link",
2516 PaymentMethodTypeFilter::Oxxo => "oxxo",
2517 PaymentMethodTypeFilter::P24 => "p24",
2518 PaymentMethodTypeFilter::Paynow => "paynow",
2519 PaymentMethodTypeFilter::Paypal => "paypal",
2520 PaymentMethodTypeFilter::Pix => "pix",
2521 PaymentMethodTypeFilter::Promptpay => "promptpay",
2522 PaymentMethodTypeFilter::RevolutPay => "revolut_pay",
2523 PaymentMethodTypeFilter::SepaDebit => "sepa_debit",
2524 PaymentMethodTypeFilter::Sofort => "sofort",
2525 PaymentMethodTypeFilter::Swish => "swish",
2526 PaymentMethodTypeFilter::UsBankAccount => "us_bank_account",
2527 PaymentMethodTypeFilter::WechatPay => "wechat_pay",
2528 PaymentMethodTypeFilter::Zip => "zip",
2529 }
2530 }
2531}
2532
2533impl AsRef<str> for PaymentMethodTypeFilter {
2534 fn as_ref(&self) -> &str {
2535 self.as_str()
2536 }
2537}
2538
2539impl std::fmt::Display for PaymentMethodTypeFilter {
2540 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2541 self.as_str().fmt(f)
2542 }
2543}
2544impl std::default::Default for PaymentMethodTypeFilter {
2545 fn default() -> Self {
2546 Self::AcssDebit
2547 }
2548}
2549
2550#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2552#[serde(rename_all = "snake_case")]
2553pub enum PaymentMethodUsBankAccountAccountHolderType {
2554 Company,
2555 Individual,
2556}
2557
2558impl PaymentMethodUsBankAccountAccountHolderType {
2559 pub fn as_str(self) -> &'static str {
2560 match self {
2561 PaymentMethodUsBankAccountAccountHolderType::Company => "company",
2562 PaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
2563 }
2564 }
2565}
2566
2567impl AsRef<str> for PaymentMethodUsBankAccountAccountHolderType {
2568 fn as_ref(&self) -> &str {
2569 self.as_str()
2570 }
2571}
2572
2573impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType {
2574 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2575 self.as_str().fmt(f)
2576 }
2577}
2578impl std::default::Default for PaymentMethodUsBankAccountAccountHolderType {
2579 fn default() -> Self {
2580 Self::Company
2581 }
2582}
2583
2584#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2586#[serde(rename_all = "snake_case")]
2587pub enum PaymentMethodUsBankAccountAccountType {
2588 Checking,
2589 Savings,
2590}
2591
2592impl PaymentMethodUsBankAccountAccountType {
2593 pub fn as_str(self) -> &'static str {
2594 match self {
2595 PaymentMethodUsBankAccountAccountType::Checking => "checking",
2596 PaymentMethodUsBankAccountAccountType::Savings => "savings",
2597 }
2598 }
2599}
2600
2601impl AsRef<str> for PaymentMethodUsBankAccountAccountType {
2602 fn as_ref(&self) -> &str {
2603 self.as_str()
2604 }
2605}
2606
2607impl std::fmt::Display for PaymentMethodUsBankAccountAccountType {
2608 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2609 self.as_str().fmt(f)
2610 }
2611}
2612impl std::default::Default for PaymentMethodUsBankAccountAccountType {
2613 fn default() -> Self {
2614 Self::Checking
2615 }
2616}
2617
2618#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2620#[serde(rename_all = "snake_case")]
2621pub enum PaymentMethodUsBankAccountBlockedNetworkCode {
2622 #[serde(rename = "R02")]
2623 R02,
2624 #[serde(rename = "R03")]
2625 R03,
2626 #[serde(rename = "R04")]
2627 R04,
2628 #[serde(rename = "R05")]
2629 R05,
2630 #[serde(rename = "R07")]
2631 R07,
2632 #[serde(rename = "R08")]
2633 R08,
2634 #[serde(rename = "R10")]
2635 R10,
2636 #[serde(rename = "R11")]
2637 R11,
2638 #[serde(rename = "R16")]
2639 R16,
2640 #[serde(rename = "R20")]
2641 R20,
2642 #[serde(rename = "R29")]
2643 R29,
2644 #[serde(rename = "R31")]
2645 R31,
2646}
2647
2648impl PaymentMethodUsBankAccountBlockedNetworkCode {
2649 pub fn as_str(self) -> &'static str {
2650 match self {
2651 PaymentMethodUsBankAccountBlockedNetworkCode::R02 => "R02",
2652 PaymentMethodUsBankAccountBlockedNetworkCode::R03 => "R03",
2653 PaymentMethodUsBankAccountBlockedNetworkCode::R04 => "R04",
2654 PaymentMethodUsBankAccountBlockedNetworkCode::R05 => "R05",
2655 PaymentMethodUsBankAccountBlockedNetworkCode::R07 => "R07",
2656 PaymentMethodUsBankAccountBlockedNetworkCode::R08 => "R08",
2657 PaymentMethodUsBankAccountBlockedNetworkCode::R10 => "R10",
2658 PaymentMethodUsBankAccountBlockedNetworkCode::R11 => "R11",
2659 PaymentMethodUsBankAccountBlockedNetworkCode::R16 => "R16",
2660 PaymentMethodUsBankAccountBlockedNetworkCode::R20 => "R20",
2661 PaymentMethodUsBankAccountBlockedNetworkCode::R29 => "R29",
2662 PaymentMethodUsBankAccountBlockedNetworkCode::R31 => "R31",
2663 }
2664 }
2665}
2666
2667impl AsRef<str> for PaymentMethodUsBankAccountBlockedNetworkCode {
2668 fn as_ref(&self) -> &str {
2669 self.as_str()
2670 }
2671}
2672
2673impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode {
2674 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2675 self.as_str().fmt(f)
2676 }
2677}
2678impl std::default::Default for PaymentMethodUsBankAccountBlockedNetworkCode {
2679 fn default() -> Self {
2680 Self::R02
2681 }
2682}
2683
2684#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2686#[serde(rename_all = "snake_case")]
2687pub enum PaymentMethodUsBankAccountBlockedReason {
2688 BankAccountClosed,
2689 BankAccountFrozen,
2690 BankAccountInvalidDetails,
2691 BankAccountRestricted,
2692 BankAccountUnusable,
2693 DebitNotAuthorized,
2694}
2695
2696impl PaymentMethodUsBankAccountBlockedReason {
2697 pub fn as_str(self) -> &'static str {
2698 match self {
2699 PaymentMethodUsBankAccountBlockedReason::BankAccountClosed => "bank_account_closed",
2700 PaymentMethodUsBankAccountBlockedReason::BankAccountFrozen => "bank_account_frozen",
2701 PaymentMethodUsBankAccountBlockedReason::BankAccountInvalidDetails => {
2702 "bank_account_invalid_details"
2703 }
2704 PaymentMethodUsBankAccountBlockedReason::BankAccountRestricted => {
2705 "bank_account_restricted"
2706 }
2707 PaymentMethodUsBankAccountBlockedReason::BankAccountUnusable => "bank_account_unusable",
2708 PaymentMethodUsBankAccountBlockedReason::DebitNotAuthorized => "debit_not_authorized",
2709 }
2710 }
2711}
2712
2713impl AsRef<str> for PaymentMethodUsBankAccountBlockedReason {
2714 fn as_ref(&self) -> &str {
2715 self.as_str()
2716 }
2717}
2718
2719impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason {
2720 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2721 self.as_str().fmt(f)
2722 }
2723}
2724impl std::default::Default for PaymentMethodUsBankAccountBlockedReason {
2725 fn default() -> Self {
2726 Self::BankAccountClosed
2727 }
2728}
2729
2730#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2732#[serde(rename_all = "snake_case")]
2733pub enum UpdatePaymentMethodUsBankAccountAccountHolderType {
2734 Company,
2735 Individual,
2736}
2737
2738impl UpdatePaymentMethodUsBankAccountAccountHolderType {
2739 pub fn as_str(self) -> &'static str {
2740 match self {
2741 UpdatePaymentMethodUsBankAccountAccountHolderType::Company => "company",
2742 UpdatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
2743 }
2744 }
2745}
2746
2747impl AsRef<str> for UpdatePaymentMethodUsBankAccountAccountHolderType {
2748 fn as_ref(&self) -> &str {
2749 self.as_str()
2750 }
2751}
2752
2753impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType {
2754 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2755 self.as_str().fmt(f)
2756 }
2757}
2758impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountHolderType {
2759 fn default() -> Self {
2760 Self::Company
2761 }
2762}
2763
2764#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2766#[serde(rename_all = "snake_case")]
2767pub enum UpdatePaymentMethodUsBankAccountAccountType {
2768 Checking,
2769 Savings,
2770}
2771
2772impl UpdatePaymentMethodUsBankAccountAccountType {
2773 pub fn as_str(self) -> &'static str {
2774 match self {
2775 UpdatePaymentMethodUsBankAccountAccountType::Checking => "checking",
2776 UpdatePaymentMethodUsBankAccountAccountType::Savings => "savings",
2777 }
2778 }
2779}
2780
2781impl AsRef<str> for UpdatePaymentMethodUsBankAccountAccountType {
2782 fn as_ref(&self) -> &str {
2783 self.as_str()
2784 }
2785}
2786
2787impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountType {
2788 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2789 self.as_str().fmt(f)
2790 }
2791}
2792impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountType {
2793 fn default() -> Self {
2794 Self::Checking
2795 }
2796}
2797
2798#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2800#[serde(rename_all = "snake_case")]
2801pub enum UsBankAccountNetworksSupported {
2802 Ach,
2803 UsDomesticWire,
2804}
2805
2806impl UsBankAccountNetworksSupported {
2807 pub fn as_str(self) -> &'static str {
2808 match self {
2809 UsBankAccountNetworksSupported::Ach => "ach",
2810 UsBankAccountNetworksSupported::UsDomesticWire => "us_domestic_wire",
2811 }
2812 }
2813}
2814
2815impl AsRef<str> for UsBankAccountNetworksSupported {
2816 fn as_ref(&self) -> &str {
2817 self.as_str()
2818 }
2819}
2820
2821impl std::fmt::Display for UsBankAccountNetworksSupported {
2822 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2823 self.as_str().fmt(f)
2824 }
2825}
2826impl std::default::Default for UsBankAccountNetworksSupported {
2827 fn default() -> Self {
2828 Self::Ach
2829 }
2830}
2831
2832#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2834#[serde(rename_all = "snake_case")]
2835pub enum WalletDetailsType {
2836 AmexExpressCheckout,
2837 ApplePay,
2838 GooglePay,
2839 Link,
2840 Masterpass,
2841 SamsungPay,
2842 VisaCheckout,
2843}
2844
2845impl WalletDetailsType {
2846 pub fn as_str(self) -> &'static str {
2847 match self {
2848 WalletDetailsType::AmexExpressCheckout => "amex_express_checkout",
2849 WalletDetailsType::ApplePay => "apple_pay",
2850 WalletDetailsType::GooglePay => "google_pay",
2851 WalletDetailsType::Link => "link",
2852 WalletDetailsType::Masterpass => "masterpass",
2853 WalletDetailsType::SamsungPay => "samsung_pay",
2854 WalletDetailsType::VisaCheckout => "visa_checkout",
2855 }
2856 }
2857}
2858
2859impl AsRef<str> for WalletDetailsType {
2860 fn as_ref(&self) -> &str {
2861 self.as_str()
2862 }
2863}
2864
2865impl std::fmt::Display for WalletDetailsType {
2866 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2867 self.as_str().fmt(f)
2868 }
2869}
2870impl std::default::Default for WalletDetailsType {
2871 fn default() -> Self {
2872 Self::AmexExpressCheckout
2873 }
2874}
2875
2876#[derive(Clone, Debug, Deserialize, Serialize)]
2882#[serde(untagged, rename_all = "snake_case")]
2883pub enum CreatePaymentMethodCardUnion {
2884 CardDetailsParams(CardDetailsParams),
2885 TokenParams(TokenParams),
2886}
2887
2888#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2889pub struct CardDetailsParams {
2890 #[serde(skip_serializing_if = "Option::is_none")]
2894 pub cvc: Option<String>,
2895 pub exp_month: i32,
2897 pub exp_year: i32,
2899 pub number: String,
2901}
2902
2903#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2904pub struct TokenParams {
2905 pub token: String,
2907}
2908
2909#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2911pub struct UpdateApiParam {
2912 #[serde(skip_serializing_if = "Option::is_none")]
2914 pub exp_month: Option<i32>,
2915 #[serde(skip_serializing_if = "Option::is_none")]
2917 pub exp_year: Option<i32>,
2918}